FROM its westernmost reaches of Aceh on the Andaman Sea to the border it shares with Papua New Guinea, Indonesia consists of more than 13,500 islands sprawling over 3,200 miles and three time zones. On July 9th, for just the third time in the country’s history, voters directly chose their president, in the world’s largest single-day election.

Turnout is likely to have been high—perhaps more than the 75% in legislative elections in April. Voters were offered a stark contrast in this race. One of the candidates, Joko Widodo, whom everyone knows as Jokowi, energised voters new to the political process because of his humble style and background and because he is not part of the establishment. Jokowi is a carpenter’s son who rose to become mayor of Solo and governor of Jakarta, the capital. His reputation is reflected in signs that his supporters waved: “Honest, Clean, Modest”. Jokowi’s rival, Prabowo Subianto, was a son-in-law of the country’s late dictator, Suharto, and a former special-forces officer with a murky human-rights record. Mr Prabowo appealed to those who yearn for a strong leader after years of drift under President Susilo Bambang Yudhoyono.

For all Jokowi’s modesty, it did not prevent him from declaring, shortly after voting ended, that initial exit polls showed victory for himself and his running mate, Jusuf Kalla. Still, the race remains too close to call definitively. Quick counts are made by extrapolating from samplings of Indonesia’s nearly 500,000 polling stations. None are official, but rather are done by dozens of independent polling firms. A poll carried out by CSIS-Cyrus Network put Jokowi at 51.9% and Prabowo at 48.1%. One by Saiful Mujani Research and Consulting had Jokowi at 52.4%-53.6%, while an Indikator Politik Indonesia poll had him leading with 52.9%.

Yet shortly after Jokowi’s claim, Mr Prabowo followed suit, declaring that he and his running mate, Hatta Rajasa, had received “a mandate from the people of Indonesia”. Indeed three quick counts done by lesser-known polling firms, whose results were broadcast on a television network owned by one of Mr Prabowo’s supporters, Aburizal Bakrie, showed him leading with an average of 50.9% of the votes to Jokowi’s 49.1%.

Assuming Jokowi prevails (official results are not due till July 22nd), it would signal a new kind of leader for the world’s largest Muslim country. Jokowi is devout: the law forbids campaigning in the three days before an election, and Jokowi used the time to make a lightening pilgrimage to Mecca. But he also embraces religious pluralism. Jokowi far outpolled Mr Prabowo among Indonesia’s religious minorities. He meets voters on the streets of their neighbourhoods, whereas past Indonesian leaders have ruled from on high. What is more, he is a politician without ties to the Suharto regime. That is a novelty.

Jokowi began the race, which officially started after the legislative elections, as the presumptive winner: back then one poll had him leading by 39 points. By election day, however, his lead had all but vanished. Mr Prabowo proved a fiery and impassioned speaker, while Jokowi remained disappointingly low-key. The former soldier ran a well-oiled campaign; Jokowi’s volunteer-led campaign was ramshackle by comparison. Mr Prabowo deflected allegations of human-rights abuses with an air of military bluffness. For some voters, that worked: Hajji Syahril Has, a 68-year-old retired entrepreneur in Kebon Kacang, a down-at-heel neighbourhood in central Jakarta, said he voted for Mr Prabowo because of his firmness and past military leadership.

Yet even though Mr Prabowo narrowed the gap with Jokowi, he seems not to have been able to reverse it. On election eve he sounded tetchy and defensive, denying in a rambling Facebook post that he was anti-democratic (earlier comments that he had made about direct elections being “not suitable for us” gave many cause to doubt him). He ranted about the “forces that want to crush me”.

In the end, however, nothing is certain until the election commission releases the official results. Neither candidate has an incentive to concede before then. While brushing off Jokowi’s declaration of victory, Mr Prabowo told his supporters to be patient. Mr Yudhoyono made a similar appeal, urging restraint on both sides. The process could stretch out even beyond July 22nd. The losing candidate might wish to contest the result in Indonesia’s Constitutional Court, which has the power to order recounts and even revotes. If the election is challenged the court has until August 22nd to announce its ruling.