"Felipe Calderon is declared president-elect of Mexico from December 1, 2006 to November 1, 2012," the head of the Federal Electoral Tribunal, Leonel Castillo, said in a public session.
President Vicente Fox promptly congratulated Mr Calderon, his former energy minister and a fellow-member of the National Action Party (PAN.)
"I congratulate Felipe Calderon, wishing him the best for his administration at the head of a great collective effort by all Mexicans," Mr Fox said.
The unanimous ruling by the seven judges confirmed that the presidential election held on July 2 was the closest ever. The tribunal's decision cannot be appealed.
Mr Calderon won over his leftist opponent Andres Manuel Lopez Obrador by just 0.56 percentage points.
Protests to continue
Mr Lopez Obrador, a popular former Mexico City mayor, has insisted he will continue to lead street protests against what he claims was massive fraud that robbed him of victory.
In their ruling the judges did recognise that there had been some irregularities in the electoral process but said they did not affect what was on the whole a free and fair election.
Mr Fox was criticised by the judges who said that he threatened the integrity of the electoral process by showing public support for Mr Calderon.
The post-election controversy, which has dominated political life in Mexico, came to a boil on Friday when 155 opposition parliamentarians prevented Mr Fox from delivering his annual state of the nation address at a joint session of Congress.
Instead, Fox was forced to broadcast his speech on television.
Mr Lopez Obrador has demanded that the election be annulled, insisted he would not recognise Mr Calderon as president, and indicated he might form a parallel government.
"Imagine where we'd be if we only went by what the tribunal decided," Mr Lopez Obrador told his followers Monday.
No compromise
His supporters have rejected outright the idea of a dialogue with Mr Calderon.
"The only possibility for a dialogue with the right's candidate would be for him to refuse the gift of the presidency which he did not earn at the ballot box," said Gerardo Fernandez Norona, spokesman for Mr Lopez Obrador's Democratic Revolution Party (PRD).
Since July 31, Mr Lopez Obrador and his backers have staged a protest in Mexico City's central Zocalo Square and on a major thoroughfare, disrupting traffic and business.
Authorities in the PRD-run city have done nothing to dislodge the protesters, and Mr Fox has rejected suggestions that he might use the army to remove them.
An opinion poll out on Monday indicated 71 per cent of Mexicans disapproved of Mr Lopez Obrador's protests and civil disobedience, while just 23 per cent supported them.
