BAKU, Azerbaijan: Something funny happened the day before Azerbaijan’s presidential election: The election commission announced the winner.

On Tuesday, a day before the voting began, the smartphone app of the Central Election Commission released results showing President Ilham Aliyev, whose family has been at the helm of the Caspian Sea nation for four decades, winning 73 percent of the vote.

After the polls closed on Wednesday, the commission said Aliyev had won 85 percent of the vote. His closest contender, Jamil Hasanli, trailed with less than 6 percent, it said.

The commission apologized for the early result, saying Thursday it had been only a test at one polling station conducted by the software developer. It expressed “deep regret” for the “misunderstanding.”

Hasanli called the vote rigged and demanded a new election.

“Ilham Aliyev has no right to represent the Azerbaijani people,” he said. “This election doesn’t reflect the people’s will.”

Observers from the Organization for Security and Cooperation in Europe (OSCE) said Thursday the election was marred by restrictions during the campaign and serious violations during the voting and during the counting of votes.

The vote “was undermined by limitations on the freedoms of expression, assembly and association that didn’t guarantee a level playing field for candidates,” the group said.

It cited detentions, criminal prosecutions, reports of physical attacks and other pressure on journalists as well as disproportionate media coverage of the president.

On voting day, the OSCE said its monitors reported ballot-box stuffing in 37 polling stations. It also called the vote count “overwhelmingly negative, with 58 percent of the observed polling stations assessed as bad or very bad.”

Triumph for democracy

Aliyev, however, hailed his victory as a “triumph of democracy” in a televised address broadcast early Thursday morning, pledging over the next five years to crack down on rampant corruption that critics claim his rule has fostered.

“The fact that this vote was free and transparent is another important step toward democracy,” Aliyev added.

The 51-year-old Aliyev came to power in a disputed 2003 vote after the death of his powerful father Heydar, a former KGB officer and Communist-era boss who ruled the ex-Soviet nation of 9.5 million people for the preceding 10 years.

He was re-elected in 2008 with 89 percent of the vote in a poll called neither free nor fair by Western observers and pushed through a referendum a year later that allowed him to run this time round.

Aliyev, who has near-total control over the media in the country, had stayed away from televised debates and passed up public rallies ahead of the polls.

Some 72 percent of Azerbaijan’s roughly five million registered voters cast their ballots, the central electoral commission said.

Strings of violations

Main challenger Hasanli blasted the election, alleging a string of violations, including voters being bussed round to cast ballots at multiple polling stations, ballot-stuffing and observers being barred from monitoring the vote.

“We will use all legal means to fight these falsifications,” Hasanli said at a press conference Thursday.

Hasanli said the opposition had applied to authorities in Baku to hold a rally Saturday but were still waiting for official permission.

“We are sure that with the strength of the people and strength of the youth, we will prevail,” he said.

Fuelled by billions of petrodollars, living standards in the mainly Muslim nation have soared in the past decade, with Azerbaijan becoming an increasingly important energy supplier to Europe and an ally of NATO.

As well as being relatively unchallenged at home, Aliyev enjoys warm relations with Washington and Moscow. Russian President Vladimir Putin was among the first to congratulate him.

Normally fragmented, Azerbaijan’s weakened opposition — much of which boycotted the 2008 poll — in May seemed primed for a genuine challenge after rallying around a single candidate.

Hasanli caused a stir in televised debates by accusing the president and his family of massive corruption, but struggled to get his message heard in a stifling pre-election atmosphere.

Rights groups accused the authorities of an intense clampdown on dissent ahead of the poll, including the jailing of scores of critics on charges the opposition say are trumped-up.

Aliyev is expected to continue treading a cautious path between the West and Russia after his expected victory, ensuring that Azerbaijan remains a key energy source for Europe and a US ally while not upsetting its giant northern neighbor Russia.

A huge issue for his new term will be the festering conflict with Yerevan over the Armenian-controlled region of Nagorny Karabakh which Baku had threatened to win back by force.

Despite years of negotiations since Armenian-backed separatists seized the region in a 1990s war that killed 30,000 people, the two sides have still not signed a final peace deal.

At home, analysts say Aliyev faces a tougher task keeping rising discontent over high-level corruption and inequality in check.