Saturday's decision by the electoral court is unlikely to resolve the political stalemate and mass demonstrations that have resulted from the July 2 poll.
Andres Manuel Lopez Obrador, the left-wing candidate, wants a full recount of each of the more than 41 million ballots cast in the election he was declared to have narrowly lost to the candidate from the ruling conservative party, Felipe Calderon.
Lopez Obrador, the former mayor of Mexico City, claims massive fraud in what has been the tightest election in Mexican history and has warned he would not accept a partial recount.
The electoral court's seven judges rejected demands to re-open every ballot box across Mexico and instead ordered a recount next week at 9% of the nearly 130,500 polling stations.
Dozens of Lopez Obrador's supporters gathered outside the court building and yelled "traitors!" after the ruling.
Lopez Obrador and his supporters have staged two huge rallies in Mexico City since the election results were announced, the largest drawing 1.2 million protesters.
Since last Sunday they have also undertaken a tent-in demonstration in the heart of the city, on the main avenue that bisects the capital, thus paralysing traffic and business and tourism activities.
Calderon says his victory by 0.6%
Calderon won the election by less than 0.6%, but says his victory was clean.
His pro-business National Action Party backed the electoral court's ruling on Saturday.
Every vote counts
"We hope this ruling helps clear up doubts and concerns about the cleanliness and transparency of the election," said German Martinez, a senior Calderon aide.
The recounts at 11,839 polling stations, largely in northern states won convincingly by Calderon, will begin next Wednesday and should be completed on Sunday.
International observers said the election was fair and most Mexicans agree, but about 35% believe the vote was rigged and about half favour a full recount, opinion polls show.