The outcome capped a stunning upset by Mahmoud Ahmadinejad, who many reformers fear will take Iran back to the restrictions imposed after the 1979 Islamic Revolution.
The Interior Ministry gave Ahmadinejad 61.8 percent of the vote over his relatively more moderate rival, Ayatollah Hashemi Rafsanjani, who had 35.7 percent. The ministry posted a notice declaring Ahmadinejad the winner of Friday's runoff.
The figures were based on about 54 percent of the estimated 23 million votes cast, or nearly 49 percent of Iran's 47 million eligible voters. In last week's first round of the presidential election, the turnout was close to 63 percent.
The victory gives conservatives control of Iran's two highest elected offices the presidency and parliament and gives a freer hand to the non-elected theocracy, which holds the final word on all important policies.
Clerics led by supreme leader Ayatollah Ali Khamenei have true power in Iran, able to overrule elected officials. But reformers, who lost parliament in elections last year, had been hoping to retain some hand in government to preserve greater social freedoms they've been able to win, such as looser dress codes, more mixing between the sexes and openings to the West.
Ahmadinejad supporters will go to mosques to hold prayers and "thank God for this great victory," said his campaign manager Ali Akbar Javanfekr. But he said no street celebrations are planned.
The streets of Tehran were quiet before dawn. State television had not been announcing the early returns so many people may not yet have known the result.
Ahmadinejad, the 47-year-old mayor of the capital, campaigned as a champion of the poor, a message that resonated with voters in a country where some estimates put unemployment as high as 30 percent. He struck the image of a simple working man against Rafsanjani, a wealthy member of the country's ruling elite.
"The real nuclear bomb that Iran has is its unemployed young people," said Ali Pourassad, after casting his vote for Ahmadinejad at a polling station set up in the courtyard of a mosque in the middle-class south of Tehran. "If nothing is done to create jobs for our young people, we will have an explosion on the streets."
Ahmadinejad had not been expected even to make the runoff. But he squeaked ahead of his rivals into the No. 2 spot in last week's first-round vote. There were accusations that Republic Guards and vigilantes intimidated voters to sway the vote in his favor.
Going into the first round, the 70-year-old Rafsanjani had been considered by far the favorite. But he was battered, placing first with only 20 percent in that round.
During Friday's voting, the reformist-led Interior Ministry reported "interference" at some Tehran polling stations. A ministry worker who was at a polling station reminding officials to watch for violations was arrested after he got in an argument with representatives of one of the two candidates, ministry spokesman Jahanbakhsh Khanjani said.
An interior ministry observers' group reported 300 complaints of violations in Tehran, said group leader Ibrahim Razini.
In the eyes of most, Rafsanjani who was president from 1989-97
represented the status quo. Backers felt confident he would continue the many social changes introduced by outgoing President Mohammad Khatami, including youth-supported freedoms such as dating, music, and colorful headscarves for women.
Ahmadinejad's surprising strength alarmed moderates and business groups at home and was watched with concern by international officials. Ahmadinejad would likely be a tough negotiating partner in Iran's talks with Europe over its nuclear program, which the United States contends aims to develop a nuclear weapon. Iran says the program aims only for producing energy.
He has criticized Iran's current negotiators as making too many concessions to Europe particularly in freezing the uranium enrichment program and he was expected to put Iran's nuclear program into the hands of some avowed anti-Western clerics.
The pragmatic Rafsanjani has appeared more willing to negotiate on the nuclear program. But a Foreign Ministry spokesman Friday underlined that the suspension is temporary and that enrichment will eventually be restarted no matter who wins the election.
But for many Iranians, the biggest issue was an economy that has languished despite Iran's oil and gas riches. Iran's official unemployment rate is 16 percent, but unofficially it is closer to 30 percent and the country has to create 800,000 jobs a year just to stand still. In the fall, another million young people are expected to enter the work force.
Ahmadinejad, the son of a blacksmith, presented himself as the humble alternative to Rafsanjani, whose family runs a large business empire. He has promised Iran's underclass higher wages, more development funds for rural areas, expanded health insurance and more social benefits for women.
"Every vote you cast is a bullet in the hearts" of the United States, said Ayatollah Ahmad Jannati, head of the Guardian Council and considered a leading supporter of Ahmadinejad.
"What they (Western countries) have is not democracy, but rule of trickery. It's parties and capitalists who get the vote of the people in their own favor to fill their pockets," he told worshippers at Friday prayers.
By Brian Murphy