TEHRAN State media declared President Mahmoud Ahmadinejad the winner of Iran's election but challenger Mirhossein Mousavi alleged irregularities and claimed victory for himself.
The state election commission said early Saturday that Ahmadinejad, a hardline conservative, was ahead with 66 percent of the votes in Friday's election after 21 million ballots were counted.
Ahmadinejad's main challenger, moderate former prime minister Mirhossein Mousavi, had 31 percent, according to the commission, which is part of the Interior Ministry. It said 61 percent of all ballot boxes had now been counted.
The official news agency IRNA said: "Dr Ahmadinejad, by winning most votes at the 10th presidential election, has secured his victory." It said results would be announced at 8 a.m. (0330 GMT).
A bitterly fought campaign has generated intense excitement inside Iran and strong interest around the world, with policymakers looking for signs of a change of approach by Tehran, whose ties with the West worsened under Ahmadinejad.
Mousavi had earlier tried to pre-empt official announcements by calling a news conference at which he alleged there had been irregularities, including a shortage of ballot papers.
"I am the definite winner of this presidential election," he declared.
It was unclear how his supporters, who thronged the streets of Tehran nightly in the run-up to Friday's vote, might react to an Ahmadinejad victory. U.S. strategic intelligence group Stratfor called the situation "potentially explosive," with a considerable risk of unrest.
Scuffles broke out early Saturday between police and chanting Mousavi supporters in a Tehran square, a Reuters witness said. Police say they have increased security across the capital to prevent any unrest. All gatherings have been banned until the publication of final results.
Analysts had said a victory for Mousavi could help ease tensions with the West, which is concerned about Tehran's nuclear ambitions, and improve chances of engagement with U.S. President Barack Obama, who has talked about a new start in ties with Tehran.
In Washington, Obama said his administration was excited about the debate taking place in Iran and he hoped it would help the two countries to engage "in new ways."
Mousavi, a former prime minister, said many people had not been able to cast their ballots even after voting was extended by four hours. At his news conference, he listed what he said were problems with the voting process.
"(We) are waiting for the counting of votes to officially end and explanations of these irregularities be given," Mousavi said. "We expect to celebrate with people soon."
Ahmadinejad draws his bedrock support from rural areas or poorer big city neighborhoods. Mousavi enjoys strong backing in wealthier urban centers, and was expected to attract votes from women and young Iranians.
Two other candidates attracted only a tiny share of the vote, according to early results. Under election rules, 50 percent of the vote is needed to win outright; otherwise a second round run-off would be held on June 19 between the two front-runners.
Long queues formed earlier at voting centers, after a heated campaign in which inflation -- officially around 15 percent -- and high unemployment were leading issues.
Ahmadinejad, 52, won power four years ago on a pledge to revive the values of the 1979 Islamic revolution. He has steadily built up Iran's nuclear program, rejecting Western charges that it is aimed at building an atomic bomb, and stirred international outrage by denying the Holocaust and calling for Israel to be wiped from the map.
Mousavi, 67, rejects Western demands that Iran halt uranium enrichment but analysts say he would bring a different approach to Iran-U.S. ties and talks on the nuclear issue. Ultimately, however, nuclear and foreign policy are determined by the country's supreme leader, Ayatollah Ali Khamenei.
The United States has had no ties with Iran since shortly after the revolution but Obama said in Washington that the United States had "tried to send a clear message that we think there is the possibility of change" in relations.
"People's strong, revolutionary and clear decision will bring about a bright future for the nation," Ahmadinejad said when he voted in a working-class part of Tehran.
"I thank all the people for their green presence which created a miracle," Mousavi said, referring to the colors worn by his backers, as he voted in Tehran with his wife at his side.
The three-week election campaign was marked by mudslinging, with Ahmadinejad accusing his rivals of corruption. They said he was lying about the state of the economy.