On election night in the world's third-largest democracy, Indonesians had the surreal option of tuning into alternative political realities. Supporters of presidential candidate Joko Widodo, or Jokowi as he is known here, could flick their television sets to MetroTV, a station that aired live footage of the Jakarta governor in his signature blue, red and white check shirt declaring he had won.

But over on TVOne, his opponent, the former army general Prabowo Subianto, was also proclaiming himself victorious, thanking the public for giving him a mandate to lead and later thrice pumping his fist into the air as he yelled merdeka (freedom).

Both candidates based their victories on differing exit polls. But with polling stations situated on more than 6,000 islands, the official vote takes weeks to compile. This race, touted as the tightest and most polarising in the country's history, was always going to be close, but few could have predicted that it would result in a political limbo and two self-declared presidents.

The impasse is unlikely to be resolved until the official result is released by the elections commission on 22 July – and perhaps not even then, if it is contested at the Constitutional Court – but the majority of reputable pollsters are putting Jokowi in the lead.

For now, the country awaits a future led by one of two very different men: Jokowi the reformer and Prabowo, representative of an old guard that indulged in unsavoury practices in the days of President Suharto.

Raised in a bamboo shack in the central Java town of Solo, Jokowi has been shaking up Indonesian politics since he was elected Jakarta governor in September 2012. A former furniture entrepreneur turned mayor of Solo, Jokowi, as governor, has made unglamorous but significant changes to the lives of average Jakartans, adding more buses, building reservoirs and encouraging greater transparency in public offices. "I've only known Jokowi for a year and I already see changes," said Angeline Christine, 30, at a central Jakarta polling booth on election day. "We need a leader who doesn't just talk and make promises."

But most importantly, Jokowi appears to have changed the way some Indonesians view their politicians: energising a previously apathetic populace by offering them an alternative to the old elite pack.

Indonesia has made laudable democratic gains since the fall of dictator Suharto in 1998, but many figures from the Suharto, or New Order, days remain influential today, as does his corrupt legacy. "In 1998 we managed to bring down the New Order. But to replace that with someone who has really been able to listen to aspirations of the people, we have failed for 16 years," says former activist and now senior Jokowi adviser Hilmar Farid. "And now we have this guy here, Jokowi." Speaking from a Jokowi volunteer centre in south Jakarta, manned by a small army of volunteers in matching check shirts and scarves, Farid said that, after 16 chaotic years of reform, Jokowi offers Indonesia a new sense of direction, and a feeling that ordinary citizens can participate in that change.

Prabowo, son of a former cabinet minister in Suharto's government, an ex-general formerly married to Suharto's daughter, is Jokowi's polar opposite. From an elite, wealthy family, Prabowo was dismissed from the military for ordering the abduction of pro-democracy activists in 1998. After a brief period in voluntary exile in Jordan, he returned to Indonesia to pursue a career in politics and has been working towards this moment for the past decade. This year is the third time Prabowo has run for president and he has become increasingly good at it, striking a chord with a large part of the population that believes Indonesia needs a commanding, decisive leader.

Critics fear that Prabowo, who has romanticised the old order, could pose a threat to Indonesia's democratic progress, but he had plenty of support at the ballot boxes. On election day his supporters pointed to political instability, such as in the Middle East, to argue that a nation strung across 17,000 islands needs a strong, unifying leader like Prabowo. "Indonesia is so big and spread out, and there are so many ethnicities and cultures, we need someone firm, with a lot of knowledge," said Anastasia Heni, as she waited to vote in the Jakarta heat.

Prabowo's unwillingness to concede has raised concerns that his team is trying to sow confusion and manipulate the official vote count in his favour. "There are rumours all over the place," said Eva Kusuma Sundari, a Jokowi campaign spokesperson. "It is really clear they are trying to push up their numbers in their own territories … because they have the structure there to manipulate the votes."

Sporadic cases of manipulated votes and tampered numbers are already flowing in to the Jokowi volunteers' hotline. In one village in the Prabowo stronghold of Madura, for example, Jokowi did not receive a single vote. "That is impossible," said Sundari, "because Jokowi volunteers and their families voted there."

Speaking after Friday prayers, Prabowo spokesperson Tantowi Yahya said it was the first he had heard of such claims. "We have fully committed ourselves to respect the rules of law, we don't interfere with the process," he said. "Like Pak [sir] Prabowo has always been saying, in this competition we are ready to win and we are ready to lose." Hashim Djojohadikusumo, the billionaire brother of Prabowo who is financing the campaign, told journalists that the other side had "hijacked democracy" by declaring victory so soon.

If the majority of credible quick counts were accurate this time – as numerous analysts say they are – manipulating the vote to secure a win for Prabowo would involve a co-ordinated and systematic effort to change up to 5% of the vote, or more than 7m ballot papers; Jokowi monitors admit there is nothing to suggest that is the case. Still, both camps have urged supporters to guard the ballot boxes, which change hands at least five times between village and national level. Far more than with any other election in the past, this one has seen Indonesians increasingly determined to ensure that their elections are free and fair.

On election day, voters loitered at polling booths to take photos of the final tally and post it on social media networks. A new app called iWitness has been developed so that local results can be cross-checked by the national body. The Jokowi campaign team has set up hotlines so that citizens can phone in reported violations. The formidable Corruption Eradication Commission (KPK) has also warned that it will crack down on collusion to rig votes. "This is a matter of the nation at large," said KPK spokesperson Johan Budi. "Do not mess around, as the KPK does not sleep."

Outgoing president Susilo Bambang Yudhoyono summoned both candidates to his private residence for talks on Wednesday, telling them to refrain from celebrating and wait for the official 22 July result. For now, with each side pledging confidence in their numbers, the country is in a political deadlock. Sundari, from the Jokowi campaign team, said she is at least cheered by one small breakthrough.

"As of last night, our monitors will be allowed in to watch the counts from the village to the national level," she said. "Before, that was impossible. Indonesia is holding its breath."