Calderon was already reaching out to other parties to build a "unity government," while his rival, Andres Manuel Lopez Obrador, blamed fraud for his narrow loss in the vote count and called on his supporters to fill Mexico City's main square Saturday in a show of force.
With the 41 million votes counted, Calderon of President Vicente Fox's National Action Party had 35.89 percent, or 15 million votes, to 35.31 percent, or 14.8 million votes, for Lopez Obrador of the Democratic Revolution Party, said Luis Carlos Ugalde, president of the Federal Electoral Institute, or IFE.
Roberto Madrazo, whose Institutional Revolutionary Party controlled Mexico for 71 years until Fox's victory in 2000, had 22.26 percent, and two minor candidates split the rest.
Ugalde confirmed Calderon as the winner at a news conference several hours after the final vote recount was made public. The IFE will not declare him president-elect, however; that is the responsibility of the Federal Electoral Tribunal. The tribunal has until Aug. 31 to resolve any challenges regarding the recount, and Sept. 6 to officially declare who is president-elect.
The next president begins a single, six-year term on Dec. 1.
Mexican stocks closed 2.7 percent higher and the peso rebounded Thursday on news of Calderon's lead in the vote count. The markets closed before the count was finished.
But many obstacles remain in Calderon's path. If his triumph is upheld by electoral courts, he will face a Congress dominated by opposition parties, as well as a divided nation that sends millions north to work in the United States illegally.
"The time has arrived for unity and agreements," a smiling, but somewhat restrained Calderon told dozens of exuberant supporters who gathered at his campaign headquarters Thursday evening and began shouting, "You did it! You did it!" to celebrate his apparent victory.
"I'm making it my personal duty to take on as my own the wishes and desires of the millions of citizens who voted for other candidates," he said.
Calderon also called on all parties to put aside politics as usual "and work together as a team."
To scattered boos, he reached out to Lopez Obrador, saying, "I not only reiterate my respect but also share his desire for justice, and I reiterate my commitment to work tirelessly ... for great equality and opportunity that will allow millions of Mexicans to overcome poverty."
U.S. President George W. Bush's decision to send National Guard troops to the border has increased tensions in Mexico, as has a U.S. congressional proposal to extend walls along the two countries' frontier.
Calderon wants to rely on Mexico's many free-trade accords to create jobs. He has vowed to crack down on rising crime and says he'll try to smooth U.S. relations without letting Washington dominate.
"I want to establish a very constructive relationship without bowing my head and lowering my eyes to the Americans," Calderon said in heavily accented English during an interview with The Associated Press.
"I have met with President Bush several times. I have interviewed with President Bush and several members of the American Congress, and I know it's possible to establish a more constructive relationship, and that would be very good for both countries."
For months, Lopez Obrador had been the front-runner in the race, promising to govern for the poor and launch big public works projects. But he slipped in the polls after he refused to take part in the first of two televised debates, and never quite recovered.
"It was Andres Manuel Lopez Obrador's election to lose, and he lost," said Andrew Selee, director of the Mexico Institute at the Woodrow Wilson Center in Washington.
On Thursday, the former Mexico City mayor said that widespread fraud, not campaign missteps, cost him the election, and he called on his supporters to gather Saturday for an "informational assembly."
"We are always going to act in a responsible manner, but at the same time, we have to defend the citizens' will," he said.
He denounced election officials for going forward with an official count of poll-workers' vote tallies, as required by election law, and ignoring his demand for a ballot-by-ballot review.
"We are going to the Federal Electoral Tribunal with the same demand, that the votes be counted, because we cannot accept these results," Lopez Obrador said.
Lopez Obrador supporters, who followed the folksy leftist with near religious zeal, wept in the streets at news of his loss. A busload of children from a private school jeered at three women bawling uncontrollably as they held up banners.
As Lopez Obrador emerged from his apartment, one woman rushed forward and startled him with a desperate embrace. Taken aback for an instant, the candidate reassured her and kissed her gently on the top of the head. Tears rolled down her cheeks.