Rent contracts and sale of the property

In case of residential real estate a property is often used by the owner and seller. In that case the buyer will be able to get the usage of the property from the moment the sale is final. But in other cases there might be contract of rent of lease. The new owner will have to deal with the tenant who uses the property.