The prison system in Mexico City has begun permitting gay prisoners to have conjugal visits from their partners.
The city authorities accepted a recommendation by a human rights commission which said the visits would help to end discrimination.
The decision follows a complaint by a man who said he had been refused permission to visit his partner in jail on the grounds they were homosexual.
A 2003 Mexican law bans discrimination based on sexual preference.
"The Mexico City department of prisons and rehabilitation has allowed the first conjugal visit to an inmate with a sexual orientation other than heterosexual," the city's human rights commission (CDHDF) said.
It was, the commission said, " an important step in terms of non-discrimination regarding sexual preference".
Prisoners are allowed conjugal visits in many Mexican jails, and most do not require the visitor to be married to the inmate.
Mexico City's centre-left government has taken a series of controversial decisions, including allowing same-sex civil unions and legalising abortion, despite strong opposition from conservatives and religious groups.