What is the ruling on renting property to someone who will commit evil deeds therein?
Question

I bought some property for the purpose of renting it out, and because I was overseas, I asked my agent to find a good tenant. He said that he found a manager who is working in a big company, and he sent me his papers, so I agreed to rent the property to him. But when I went back to my country, I discovered that the property had been rented to someone who turned it into a brothel, so I asked him to leave immediately. My question is: is the rent that I have received up till now haraam?
Praise be to Allah.With regard to renting property to someone who will commit evil deeds therein, there are three scenarios: 
1. Where the property is rented out with the aim of using it for haraam purposes, in the sense that the haraam usage is the aim of the contract, such as renting an apartment to someone who will use it for the purposes of prostitution, or renting a shop to someone who will use it as a bar or dance hall, and the like. 
Such contracts are invalid, and the rent that is received from them is haraam and must be gotten rid of by spending it on various charitable causes. 
In al-Mawsoo‘ah al-Fiqhiyyah (8/228) it says: It is not permissible, according to the majority of fuqaha’, to rent out a building for Islamically unacceptable purposes, such as when the tenant will use it as a place for drinking alcohol or gambling, or as a church or idolatrous place of worship. 
In that case it is haraam to accept rent for it, just as it is haraam to pay such rent, because it comes under the heading of helping in sin. End quote. 
This has been discussed previously in the answer to question no. 152481 
2. Where the property is rented out to someone who will use it for permissible purposes, such as a place to live, or for buying and selling, or practising a permissible trade, and the like. 
Such contracts are valid and there are no reservations about them. If the tenant commits some evil actions whilst using it for permissible purposes, that does not affect the validity of the contract, and the rent received for it does not become haraam. 
As-Sarkhasi (may Allah have mercy on him) said:
There is nothing wrong with a Muslim renting out a house to a dhimmi (non-Muslim living under Muslim rule). Then if he drinks wine there, or worships the cross, or brings pork there, the Muslim does not incur any sin because of that, because he did not rent it out for that purpose, and the sin is the deed of the tenant, which he did without the landlord intending for that to happen. So there is no sin on the landlord in that case. 
End quote from al-Mabsoot (16/39) 
In a question addressed to the sharee‘ah committee of the Dubai Islamic Bank, it says:
We hope that you can advise us on the ruling on renting out a shop for a permissible purpose, then the tenant mixes that with something haraam. 
The response was:
With regard to rentals, what matters is the basic purpose of the activity for which the rented property will be used. In this case it is trading in permissible goods, and on that basis the rent for the shop is permissible, and the responsibility for adding haraam goods for sale rests with the tenant. At the same time, one should strive to take measures and stipulate conditions that will prevent this from happening again in the future, when one is able to enforce these conditions. 
This is different from a case where a shop is rented to be used specifically for selling alcohol or pork. 
End quote from Fataawa Hay’at al-Fataawa wa’r-Raqaabah ash-Shar‘iyyah li Bank Dubai al-Islami, fatwa no. 86 
We have previously quoted the words of the scholars affirming that, in the answer to question no. 98555  
3. Where the property is rented out for a permissible purpose, then the tenant changes the agreement and uses the property for a haraam purpose without the knowledge of the landlord. 
In this case, there is no blame on the property owner for accepting the rent during the past period before he found out what was really happening. 
But once he has found out what is really happening, he must cancel the agreement and make the tenant leave the property. 
Shaykh ‘Atiyah Saqar (may Allah have mercy on him) said: 
When renting out property, one of two scenarios must apply: 
either the landlord was aware that the tenant was committing the haraam activity, such as if he stipulated in the contract that the rental was for this purpose, or he did not stipulate anything but he was aware that the haraam activity would be committed there; 
or he was not aware of that. 
In the latter case, the rental is valid, and the rent is rightfully his and is halaal, according to the consensus of the imams. 
But in the former case, the three imams said – and Abu Yoosuf and Muhammad, among the companions of Abu Haneefah agreed with them – that the rental is rendered invalid, because it is based on sin.
End quote from Fataawa Dar al-Ifta’ al-Masriyyah (9/374) 
Based on that: 
Because you rented the property to this man for him to live in it, the rent that was paid for it is permissible, and his use of the apartment for prostitution does not make the rent haraam, because you did not rent the property to him for the purpose of committing this evil deed, and you were not aware of it. 
But you did well to make him leave the accommodation as soon as you found out what was going on. 
We ask Allah to bless your wealth for you and to grant you wholesome and halaal provision. 
And Allah knows best.