THE country where the Arab spring began is poised to complete a momentous transition from dictatorship to democracy when voters go to the polls on October 26th. The vote should seal Tunisia’s title as the sole success of the region’s uprising. But despite the historic moment, splits between Islamists and secularists, sporadic clashes with jihadists and exuberant participation—more than 100 parties are jostling for places in the National Assembly—political tempers are cool.

One reason is that this country of 11m is more orderly than most, and very much more so than its turbulent Arab neighbours. Among strict rules enforced by an independent election commission is a ban on election posters except in numbered, equal-sized boxes at municipally decreed sites. Such sobriety also reflects the fact that, after three years of post-revolutionary turmoil, many Tunisians say they are fed up with politics. But perhaps a more important reason for the calm is that the outcome is fairly predictable. No party is likely to win outright. Tunisia’s next government will almost certainly be a coalition, pursuing a middle-of-the-road reformist policy based on a national consensus.

Besides, before a new government is installed, parties will wait for a president to be chosen. With 27 candidates vying in next month’s first-round vote, polling results are unlikely to be known until a run-off on December 28th. If one party dominates the assembly, which has a powerful role under a new constitution, it may be balanced by a president of a different stripe. Nahda, the disciplined Islamist group that grabbed a winning 37% of the vote three years ago in a ballot for a constitutional assembly, has soothed fears of secular Tunisians by declaring that it will not field a presidential candidate.

Yet there is plenty of underlying unease. After overthrowing Zine el-Abidine Ben Ali in January 2011, the Tunisian revolution avoided much of the violence that engulfed other Arab countries. But its aftermath has not been easy. Only a year ago the country’s future looked bleak. Negotiations over the constitution had stalled. A three-party coalition government, led by Nahda, appeared unable to tackle either economic or security challenges; radical Salafists profited by new-found freedom to agitate, with growing violence, for stricter religious rules, such as enforcing veils for women and segregating girls in schools. Alarmed secularists muttered about the need to reimpose a strict police state.

That crisis came to a happy ending. Parts of Tunisia’s relatively strong civil society, including trade unions and businessmen, intervened to force politicians into compromise. The toppling of the Muslim Brotherhood in Egypt convinced Nahda hardliners to lower their sights. “The Egyptian Brothers were blinded by their electoral strength and thought they could ignore other factors,” says Lotfi Zitoun, a senior Nahda adviser, explaining that his milder-mannered party was determined to avoid the same mistake.

In short order, Nahda endorsed a law to ban the most extreme Islamists, agreed to dilute overtly Islamist language in the constitution and handed power to a caretaker government of technocrats, tasked chiefly with preparing for fresh elections. So smoothly has this government functioned that its prime minister, Mehdi Jomaa, recently polled as Tunisia’s most popular politician. A campaign against extremists has reduced violence in recent months.

By shifting to the centre, though, Nahda has alienated parts of its Islamist constituency that now have few legitimate channels for expression: some are among the estimated 3,000 Tunisians who have joined jihadists in Iraq and Syria. Old-school secularists, meanwhile, speak of excluding Nahda from a future coalition, with hopes of eventually squeezing the Islamists altogether from politics. “The potential threat from Tunisia’s pre-revolutionary deep state should not be dismissed,” reckons one analyst.

Tunisia’s economy was underperforming even before the 2011 revolution. A recent, sobering World Bank report notes that a mix of rigid government rules and misguided policies, such as promoting maquiladora-type factories for export while protecting politically connected local industry, has led to glaring misallocations of resources. Four-fifths of Tunisia’s workforce is employed in low-productivity sectors, and jobs are concentrated along the country’s coast: in more remote areas 45.9% of university graduates are unemployed. Extreme poverty may be rare, but many Tunisian families struggle to get by.

Increasingly, resentful youths drift not only to political extremes but into a semi-criminal underground economy. Along Tunisia’s porous and thinly-peopled borders with Algeria and Libya, there is a danger of networks merging between smugglers of arms, drugs and other contraband, and jihadist guerrillas, warns a recent report from the International Crisis Group, a think tank. In some remote areas, small jihadist bands have held out against widening security action. Few observers see a near-term risk of these badlands spreading. Tunisia’s strong middle class and effective state institutions represent imposing barriers to jihadist infiltration. But possible shocks, such as a large refugee exodus from troubled Libya, could change the balance.

A worry to some Tunisians is that the elections themselves could cause trouble. An unusually low turnout, or bitterly contested results, could undermine confidence in the new government’s legitimacy. So could a protracted negotiation over forming a cabinet, especially if the vote is split among a wide array of parties.

Still springy

Luckily Tunisia’s political leaders, both Islamist and secularist, appear to agree on what to do about economic reform and security. Mr Zitoun talks of the need to make “surgical” decisions with the economy. Beji Caid Sebsi, the leader of the secularist Nidaa Tounes, whose sharp wit and powerful voice belie his 87 years, insists that, whatever the result of the vote, his party will not rule alone. “We know exactly the danger of one-party rule,” he says, with a glance at the giant bust in his office of Habib Bourguiba, the independence leader who ruled Tunisia for 30 years.