With more than 8 million votes counted, the Interior Ministry said the reformist-backed Rohani had more than 52 percent of the June 14 vote -- easily above the 50 percent needed for outright victory.
The results show conservative Tehran Mayor Mohammad Baqer Qalibaf in second with 17 percent.
If needed, a second round would be held next week, on June 21.
Authorities have estimated voter turnout at above 70 percent.
Some 50 million voters were eligible to choose between six candidates to replace President Mahmud Ahmadinejad, who has served the maximum two consecutive terms.
All six candidates were approved to campaign by the conservative, unelected Guardians Council.
After casting his vote in Tehran, Supreme Leader Ayatollah Ali Khamenei dismissed those who questioned the democratic nature of the election.
"I recently heard that someone from America’s National Security Council said, ‘We don’t accept this election in Iran.' Well, to hell with you if you don’t accept it," Khamenei said.
Khamanei did not make clear whom he was referring to. But last month U.S. Secretary of State John Kerry cast doubt on the credibility of the election following the disqualification of hundreds candidates, including those whom observers considered potential reformers and all the women who wanted to run.
Kerry criticized what he called a "lack of transparency" in the election process and said the disqualifications were "based solely on who represents the regime’s interests."
Candidate Rohani has recently called for greater freedom of expression and promised to free political prisoners. He also supports the continuation of Iran's controversial nuclear program.
PHOTO GALLERY: The faces of Iran's voters
Many Western states say the program is being used as cover for building a nuclear weapon.
Former Iranian Presidents Mohammad Khatami and Akbar Hashemi Rafsanjani, as well as the supreme leader's younger brother, Hadi Khamenei, have lent their support to Rohani.
The candidates took part in three debates that were broadcast live on national television. They discussed their positions on foreign and domestic policies and social issues, among other topics.
A Tehran resident, who didn’t want to give his name, told RFE/RL’s Radio Farda that the debates had an impact on some voters.
"From what I heard, Mr. Rohani’s candidacy has been attracting attention. Especially because of the third televised debate between the candidates, more people got to know him," he said. "Reformists and those who are close to those circles know him. They know [whom they are voting for], but many others did not know [Rohani]. I think the third debate left an impact.”
A resident of Bushehr said he has decided not to vote “because of the experience of the last election in 2009” when government critics said the vote was rigged to ensure Ahmadinejad’s second term in office.
"I live in a small city," he said. "My impression is that the atmosphere of the current election did not have the excitement of the previous election."
There are more than 50.5 million eligible voters in Iran. A simple majority of votes -- 50 percent plus one -- is required to win the election.
If there is no simple majority, a runoff between the two candidates with highest number of the votes will be held on June 21.
No international observers are monitoring the election process.
The new president will take office in late August. The president is constitutionally limited to two consecutive terms. Ahmadinejad will step down after eight years in power.
The June 14 vote comes four years after security forces cracked down on protesters who believed Ahamdinejad's reelection had been secured through massive electoral fraud.