Updated

Mexico's old ruling party cleared the last hurdle in regaining the presidency it held for 71 years, after the country's highest electoral court dismissed legal challenges brought by a leftist opponent trying to overturn the July 1 election.

In a unanimous ruling Thursday night, the seven-member Federal Electoral Tribunal dismissed the case and opened the door for the Institutional Revolutionary Party to retake the presidency it lost in 2000. It had ruled Mexico without interruption from 1929 to 2000.

PRI candidate Enrique Pena Nieto won the July 1 ballot by a 6.6-point margin over leftist Andres Manuel Lopez Obrador, who then challenged the results by alleging Pena Nieto engaged in widespread vote buying and campaign spending excesses

Before voting, all seven justices said they did not think supporters of Lopez Obrador had submitted convincing evidence of the alleged abuses.

"Mexico has a president elected by the people, in the person of Enrique Pena Nieto," said Justice Salvador Nava.

Justice Flavio Galvan dismissed evidence submitted by the leftist coalition regarding purported abuses by Pena Nieto's campaign as "vague, generic, imprecise." The evidence included gift cards, household goods and even farm animals purportedly given out to voters by the PRI.

Outside the courthouse, demonstrators who believe Pena Nieto got an unfair advantage from media outlets, pollsters and campaign donors reacted with outrage.

About 200 demonstrators chanted "No to imposition" and "Defend democracy," and some grabbed steel security barriers that ring the courthouse and began banging them against the building's gates. One youth group called for a "funeral march for democracy" on Friday.

Ricardo Monreal, Lopez Obrador's campaign manager, said the justices "are acting like a gang of ruffians."

The justices said some of the evidence submitted was hearsay, or unclear. For example, they said the evidence included gifts allegedly given out by Pena Nieto's party, the PRI, without proof that was where they came from or that the gifts had been given to influence votes.

Monreal complained that the justice wanted his coalition "to supply not just the evidence, but the victims and criminals" as well.

The court appeared to have done little if any of its own investigation of the accusations, which centered on hundreds and possibly thousands of pre-paid gift cards that shoppers at a Mexican grocery store chain said they were given by Pena Nieto's party before the election.

The Associated Press interviewed about a half dozen people among shoppers who mobbed one Soriana store two days after the elections to redeem the cards; almost all said PRI supporters had given them the cards, expecting they would vote for the party.

The court did not apparently interview any card recipients. Galvan said only that "there is no proof of vote-buying."

"It has not been demonstrated that they (the cards) were given to citizens, or if that occurred, that it was done on condition they vote for a given candidate," Galvan said.

Justice Pedro Penagos agreed, saying: "Even though the existence of the Soriana cards is proven ... it has not been proven they were handed out, nor that they were in exchange for votes for Enrique Pena Nieto."

Pena Nieto commented in his Twitter account that "now is the time to start a new stage of work, for the good of Mexico."

PRI party spokesman Eduardo Sanchez said that "the (electoral) competition has ended and starting today, we have to work together."

"In the PRI, we are aware there very talented and valuable people in all the political parties, with very good ideas and solution to our problems, and we are ready to sit down with them to talk," Sanchez said.

The court's ruling also came as electoral authorities are still investigating whether Pena Nieto's campaign had exceeded campaign spending limits. To outsiders, it appeared much better funded than his rivals'.

The justices said those investigations can continue, but wouldn't be grounds for overturning the vote.

The ruling by the full court, expected later Thursday, would be the final step before what is widely expected to be the tribunal's confirmation of Pena Nieto's victory.

According to the official count, Pena Nieto won 38 percent of the votes, followed by Lopez Obrador of the leftist Democratic Revolution Party at about 31 percent.

The PRI has denied wrongdoing. A confirmation of its victory would end a 12-year PRI absence from Mexico's highest office, which it held without interruption from 1929 to 2000.