Mexico City lawmakers have approved a measure to allow terminally ill patients to refuse treatment.
The bill has to be signed into law by Mayor Ebrard
The local assembly voted unanimously in favour of the bill enabling patients living in the city to suspend treatment if it only prolongs life.
Family members of terminally ill people who are paralysed but can express themselves can also sign the order if two witnesses are present.
The bill still has to be signed into law by Mayor Marcelo Ebrard.
It could still be the subject of a legal challenge in this conservative Catholic country.
However, Hugo Valdemar, a spokesman for the Archdiocese of Mexico, told El Universal newspaper that the Catholic Church had no issues with the measure, which only applies to Mexico City.
But Mr Valdemar added that the Church was concerned that the bill could be a first step towards legalising euthanasia, which he said would be unacceptable.
The measure allows "death without unnecessary suffering when death is inevitable" said assembly member Victor Hugo Cirigo.
It states that under no circumstances could drugs be supplied which could cause the death of a patient.
Patients wishing to forgo treatment would have to sign a release before a public notary indicating their desire to stop treatment.
Immediate family members would make the decision for minors and mentally impaired patients.
Health workers could declare themselves conscientious objectors and opt out of treating patients who decide not to lengthen their lives.
The bill also allows patients to specify if they want to donate organs.
The left-wing congress in Mexico City has recently passed a series of laws which are considered liberal in Latin America, such as legalising abortion in the first months of pregnancy and allowing gay marriages.