Updated

Yemen's president was re-elected with more than 77 percent of votes in the face of the strongest challenge since he came to power 28 years ago from an opponent with a substantial popular following, officials said Saturday.

But the opposition alleged fraud and immediately rejected the result.

Elections commission chief Khaled Sharif said the final tally showed Saleh received 4.1 million votes, or 77.17 percent of 5.3 million valid votes, while challenger Faisal bin Shamlan won 1.1 million votes, or 21.82 percent.

FOX News CountryWatch: Yemen

More than 6 million of Yemen's 9.2 million registered voters cast ballots on Wednesday, putting turnout at 65 percent. Tens of thousands of ballots were discarded because of voter error, he told a news conference.

Opposition parties backing bin Shamlan immediately rejected the election commission's results, claiming their candidate won at least 40 percent. A spokesman said the opposition would announce its own results Sunday.

"What has been announced is not true and is illegal," said Ali al-Sarari, an opposition spokesman. "There has been tampering in the results of the elections and the regime in Yemen is still autocratic."

The elections confronted Saleh with his first serious challenge since coming to power in 1978. It was the first time in modern Arab history that a president went head-to-head with an opponent who had a substantial popular following.

In 1999, Yemen held its first presidential election by popular vote, and Saleh won with 96.2 percent. His only challenger was a former member of his ruling party running as an independent.

Shortly after the results were announced, the sound of celebratory gunfire rang out across Yemen's capital.

The Interior Ministry cautioned Yemenis against firing their weapons or setting off firecrackers, saying those who violate the order would be prosecuted.

Three other names appeared on presidential ballots, but one of the candidates dropped out of the race a few days before election day and another urged his supporters to vote for bin Shamlan. The commission statement said Fathi al-Azab got 24,524 votes, or 0.46 percent; Yassin Abdu Saeed won 21,642, or 0.40 percent; and Ahmed al-Majidi earned 8,324, or 0.15 percent.

The opposition's rejection of the results will likely increase tension between Saleh's ruling party, the General People's Congress, and the opposition Joint Meeting of Parties.

On Friday, the opposition threatened to encourage millions of supporters to take to the streets to prove they numbered more than initial election results indicated.

Yemeni Foreign Minister Abubakr al-Qirbi has rejected claims of fraud and said the criticism raised government concerns that opposition parties "are not really committed to democracy, that their interest is really to rule, and not to promote democracy."

Saleh has ruled since 1978, first as president of North Yemen and then as head of the unified state after the May 1990 merger of North and South. He was re-elected for another seven-year term.

Bin Shamlan ran refineries in South Yemen during the 1970s and was an executive for a Saudi oil company in London. He served as minister of infrastructure and minister of oil in the government of South Yemen. He resigned from parliament in 1995 to protest government corruption.