Updated

Mexico's supreme court has narrowly voted to let the Mexico City government keep a piece of land but orders it to pay the owners. The ruling ends a dispute that nearly upended the country's last presidential election.

The justices say in a 6-5 decision that since a road has already been partly built on the land, it doesn't have to be returned.

Thurday's ruling calls for a lower court to determine the compensation amount.

Leftist Andres Manuel Lopez Obrador was nearly impeached as Mexico City mayor for ignoring a court order to return the property in 2005. The impeachment move led to huge protests in the mayor's support as it threatened his 2006 run for president.

Lopez Obrador lost a close election to conservative Felipe Calderon.