Something funny happened the day before Azerbaijan's presidential election: The election commission announced the winner. 
 
 Supporters of Azerbaijan's President Ilham Aliyev celebrate his victory in the presidential elections in Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Azerbaijan’s president won a third five-year term by... (Associated Press) 
 
 Supporters of Azerbaijan's President Ilham Aliyev celebrate his victory in the presidential elections in Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Azerbaijan’s president won a third five-year term by... (Associated Press) 
 
 An Azeri woman holds her ballot paper as she stands in voting cabin at a polling station in Nardaran, 35 kilometers (22 miles) north of Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Oil-rich Azerbaijan is... (Associated Press) 
 
 Azerbaijan President Ilham Aliyev seen during the voting at a polling station in Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Oil-rich Azerbaijan is booming and the wealth is trickling down to its poorest... (Associated Press) 
 
 Azerbaijan President Ilham Aliyev leaves a polling station in Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Oil-rich Azerbaijan is booming and the wealth is trickling down to its poorest people. It all means... (Associated Press) 
 
 An Azeri man casts his ballot as official looks on at a polling station in Nardaran, 35 kilometers (22 miles) north of Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Oil-rich Azerbaijan is booming and the... (Associated Press) 
 
 Azeri women cast their ballot papers at a polling station in Nardaran, 35 kilometers (22 miles) north of Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Oil-rich Azerbaijan is booming and the wealth is trickling... (Associated Press) 
 
 Supporters of Azerbaijan's President Ilham Aliyev celebrate his victory in the presidential elections in Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Azerbaijan’s president won a third five-year term by... (Associated Press) 
 
 Azerbaijan President Ilham Aliyev, right, listens to unidentified official after voting at a polling station in Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Oil-rich Azerbaijan is booming and the wealth... (Associated Press) 
 
 A voter reads a ballot paper as he stands in voting cabin at a polling station in Nardaran, 35 kilometers (22 miles) north of Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Oil-rich Azerbaijan is booming... (Associated Press) 
 
 Supporters of Azerbaijan's President Ilham Aliyev celebrate his victory in the presidential elections in Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Azerbaijan’s president won a third five-year term by... (Associated Press) 
 
 Supporters of Azerbaijan's President Ilham Aliyev celebrate his victory in the presidential elections in Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Azerbaijan’s president won a third five-year term by... (Associated Press) 
 
 Supporters of Azerbaijan's President Ilham Aliyev celebrate his victory in the presidential elections in Baku, Azerbaijan, Wednesday, Oct. 9, 2013. Azerbaijan’s president won a third five-year term by... (Associated Press) 
 
 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 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." 

 
 
 Azerbaijani President Ilham Aliyev votes in Baku on Wednesday. (AFP/Getty Images) 
 
 Update, Oct. 28: This post has been updated to reflect the government of Azerbaijan's official statements. 
 
 Azerbaijan's big presidential election, held on Wednesday, was anticipated to be neither free nor fair. President Ilham Aliyev, who took over from his father 10 years ago, has stepped up intimidation of activists and journalists. Rights groups are complaining about free speech restrictions and one-sided state media coverage. The BBC's headline for its story on the election reads "The Pre-Determined President." So expectations were pretty low. 
 
 Even still, one expects a certain ritual in these sorts of authoritarian elections, a fealty to at least the appearance of democracy, if not democracy itself. So it was a bit awkward when Azerbaijan's election authorities released vote results – a full day before voting had even started. 
 
 The vote counts – spoiler alert: Aliyev was shown as heading toward a landslide – were pushed out on an official smartphone app run by the Central Election Commission. It showed Aliyev as "winning" 72.76 percent of the votes, although with only about 15,000 votes cast, as Azerbaijani officials later noted as part of their defense that the results had been partial and a test run. That share is on track with his official vote counts in previous elections: he won ("won"?) 76.84 percent of the vote in 2003 and 87 percent in 2008. 
 
 
 
 The Azerbaijani Central Election Commission sent out these vote totals to its official smartphone app before voting started. (meydan.tv) 
 
 In second place was opposition candidate Jamil Hasanli with 7.4 percent of the vote. Hasanli had recently appealed to the Central Election Commission for paid airtime on state TV, arguing that Aliyev gets heavy airtime and the opposition does not. He was denied. 
 
 The data were quickly recalled. Initially, the official story was that the app's developer had mistakenly sent out the 2008 election results as part of a test. But that's a bit flimsy, given that the released totals show the candidates from this week, not from 2008. 
 
 Government officials later defended the release, which they noted shows fewer than 15,000 votes in a country of 9 million. They said it had been only a trial run, posted in error, showing hypothetical results from one small electoral district. 
 
 You might call this a sort of Kinsley gaffe on a national scale. (A Kinsley gaffe, named for journalist Michael Kinsley, is when a politician gets in trouble for saying something that's widely known as true but that he isn't supposed to say.) There's supposed to be a certain ritual to an election like Azerbaijan's: demonstrations are put down, reporters are harassed, opposition candidates are whittled down, supporters are ushered to the polls and then Aliyev's sweeping victory is announced. They got the order wrong here. 
 
 As of this writing, Azerbaijan's election authorities say they've counted 80 percent of the ballots, with Aliyev winning just under 85 percent of the vote so far. He's been officially reelected. 
 
 More from WorldViews: 
 
 • An infographic guide to Syria’s chemical weapons and how they work 
 
 • North Korea’s nuclear program just became self-sufficient. Why that’s scary. 
 
 • This Jon Stewart episode is everything wrong with how we talk about Syria 

 Azerbaijan election: the pre-determined president 
 
 Protests against the government have been stifled 
 
 Continue reading the main story Related Stories 
 
 Azerbaijan elects a president on Wednesday in what human rights organisations say is a stifling atmosphere of intimidation. 
 
 Ilham Aliyev, who has run the oil-rich ex-Soviet republic since he succeeded his father 10 years ago, is standing for a third term. 
 
 During his presidency, allegations of high-level corruption, the subversion of democracy and the stifling of dissent have been rife, with reports of politically motivated arrests shooting up drastically in the last two years. 
 
 The pre-election period has, nonetheless, been a relatively calm one. 
 
 But it is "post-election disorder" that worries the authorities, the Brussels-based International Crisis Group said in a recent report. 
 
 In custody 
 
 Riots over corruption in regions like Ismayilli and Quba in January were seen as a sign of major public discontent with regional governors and, in effect, the ruling elite. 
 
 In Ismayilli, the governor's son's car and hotel were set on fire after he reportedly insulted the residents. 
 
 It was a small wave of unrest, but clearly worried the authorities and the repercussions continue. Ilgar Mammadov, a human rights defender and leader of the political movement ReAL who went to the region after the unrest erupted, was charged in February with causing mass unrest. 
 
 While his trial is pending, he put forward his candidacy for the elections - which was rejected due to "invalid signatures". Mr Mammadov is one of 14 people described by Amnesty International as prisoners of conscience in Azerbaijan. 
 
 Human rights organisations put the number of political prisoners between the tens and the hundreds. 
 
 Seven of them are leading members of the youth movement Nida, who were detained in April while protesting against corruption and face charges of causing mass unrest and possessing illegal firearms. 
 
 They are known for their frequent posts on Facebook and Twitter about alleged government corruption and human rights abuses. 
 
 Azeri political analyst Rashad Shirinov told the BBC that Nida was "one of the most active and vivid youth forces" in the country and could have had an impact on the campaign had its leader not been arrested. 
 
 Around the same time as the Nida arrests, Dashgin Melikov, an asthmatic young activist critical of the government, was also charged with illegal drugs possession and sentenced to two and a half years in prison. 
 
 Until last week, he was a member of one of two major opposition parties, the Azerbaijani Popular Front. 
 
 Mr Aliyev has already served two terms 
 
 But then in an open letter he wrote from prison, Mr Melikov renounced his party and declared his support for Ilham Aliyev. His father told BBC Azeri that his son's illness was a factor in his decision - and that he had been promised freedom in return. 
 
 The government insists that nobody is imprisoned for their political activities, and that their activism does not mean that they are not criminals. 
 
 Yet according to Human Rights Watch, the Azerbaijani authorities use "spurious drug possession charges to lock up political activists critical of the government" ahead of the elections. 
 
 Contenders 
 
 The main competition to Ilham Aliyev comes from former MP Professor Jamil Hasanli, a candidate from the National Council opposition bloc. For the first time in more than two decades the in-fighting within the main opposition, already seen as weak, was put aside to choose a single candidate. According to Shirinov, this in itself is an achievement. 
 
 He says that there are a number of fake candidates, installed by the ruling elite to confuse the citizenry, to counter the opposition's candidate. "This is very visible during the TV debates when all other candidates attack Jamil Hasanli," he says. 
 
 A spokesman for the ruling New Azerbaijan Party, Aydin Mirzazadeh, dismisses these allegations, saying that every vote for another candidate is a vote against the government, and Azerbaijan's Central Election Committee (CEC) boasts of pluralism. 
 
 But one of the main election observers, the OSCE, has been critical of the election environment from the start, saying there has been little substantive debate, unjustified restriction of freedom of speech and imbalanced media coverage. 
 
 In addition to Ilgar Mammadov's disqualification, a second prominent candidate, popular cinematographer Rustam Ibrahimbayov, has been barred because of his dual Russian citizenship. 
 
 Three terms 
 
 Ilham Aliyev changed the constitution through a referendum in 2009 which got rid of the two-term limit for presidents, allowing him to stand for re-election this year. 
 
 The opposition, however, argues that the candidacy is invalid because the constitution was changed after Mr Aliyev was sworn in as president in his second term. 
 
 Prof Hasanli has formally complained to the CEC, with sources close to him saying the case will go "to the highest courts". 
 
 Observers believe there is only one conceivable outcome from the election - another term for President Aliyev. 
 
 Yet after the unprecedented outbursts of violence against corruption in Azerbaijan's regions, it is the period immediately after the election that will determine how popular Ilham Aliyev really is.
– Voting for the next president of Azerbaijan wasn't supposed to start until yesterday—but the day before, results were already amazingly posted on a Central Election Commission smartphone app. The app said incumbent president Ilham Aliyev was winning with 73% of the vote, continuing his family's decades-long reign (the Washington Post has a screenshot). The early results were quickly removed, and when actual voting commenced, the commission said Aliyev had managed 85% of the vote, compared to the runner-up's 6%. The election was never actually expected to be free or fair, the Post notes. Today, the commission apologized for the advance result, claiming it was spurred by software testing. But runner-up Jamil Hasanli wasn't satisfied. "This election doesn't reflect the people's will," he said. Outside observers cited a deeply flawed voting process, including "limitations on the freedoms of expression, assembly, and association that didn't guarantee a level playing field for candidates," the AP reports. Political activists in the country have been falsely imprisoned, says Human Rights Watch; and an analyst says fake candidates ganged up on Hasanli during debates, the BBC reports. Officials fear "post-election disorder," monitors say, following anti-corruption riots earlier this year.