It is understood to be the first Holyrood legislation to be given royal assent by the King.
The Cost of Living (Tenant Protection) Act allows ministers to temporarily freeze rent increases for private and social tenants, and for student accommodation.
It applies to in-tenancy rent increases, with the cap set at 0 per cent from September 6 until at least March 31 next year.
Scottish ministers can extend the temporary legislation for a further two six-month periods if it is deemed necessary.
Protections have been put in place for landlords who are experiencing extreme cost increases.
Rents can be increased if the landlord can prove their property costs have soared – provided the increase is less than 50 per cent of the jump in property costs.
The law also prevents evictions over the same period, except in a number of specified circumstances.
Damages for unlawful eviction have also been increased to a maximum of 36 months’ worth of rent.
Tenants’ rights minister Patrick Harvie said: “Many people who rent their homes are facing real difficulties as a result of the cost-of-living crisis.
“While bills are rising for all of us, many tenants are more exposed as they are more likely to be on low incomes or living in poverty than other people.
“These measures aim to give tenants greater confidence about their housing costs and the security of a stable home.
“Some landlords may be feeling the effects of this crisis too. So while the primary purpose is to protect tenants, the emergency measures also include safeguards for those landlords who may be impacted.
“For anyone struggling with their rent, I would urge you to contact your landlord, an advice organisation or a tenants’ union to get help as early as possible.”
MSPs approved the Bill on temporary rent freezes in the Scottish Parliament on October 6, where it was then progressed for royal assent.