Foreigners can buy property but you need a bank that will hold the title in trust. The bank holds the (naked) title for the property and serves as the trustee for the property. It can be a house, condo, etc. The buyer of the property is named as the beneficiary of the trust and enjoys full ownership rights. That means that they can occupy it, rent it out, renovate it, get a mortgage, leave it to someone in their will.
The bank does not own the property. The naked title means that it is a title without benefits. The bank cannot sell, depreciate, lease or exercise any control over the property. In fact, the bank is not even permitted to list the property as an asset for accounting purposes.
The trust is valid for a maximum of 50 years (Artículo 13, Ley de Inversión Extranjera), but it can be renewed indefinitely. If someone sold a property with many years left on the trust to another foreigner, then the new buyer can assume the existing trust. The cost to maintain the trust averages around $500 USD a year. This fee is charged by the bank for providing the service.
The term for this is called the fideicomiso. As a writer, I purchased a property in Puerto Vallarta, Mexico a few years ago and have no regrets. I live in Sea River Tower at Sunscape Spa & Resort. The view of the ocean is amazing and the city is both safe and friendly. Someone told me it is one of the locations in the world with the most days of sunshine.
I will probably “will” the property to my daughter. I know she will also enjoy owning a property in Mexico. I feel like it is like owning a part of paradise.