The gracious loser is a stock character of American elections, and virtually unknown in the Arab world.

Rachid Ghannouchi makes an unlikely pioneer. The 73-year-old politician is one of the world’s most influential Islamist thinkers and the longtime leader of Tunisia’s offshoot of the Muslim Brotherhood. To his detractors, his sins range from indulging in “double discourse”—saying one thing to Westerners and another to his flock—to peddling anti-Semitism and supporting terrorists.

His public record is long. “We must wage unceasing war against the Americans until they leave the land of Islam,” he said in a speech in Sudan, coming to Saddam Hussein ’s defense after Iraq invaded Kuwait. He tells me that those words “were fabricated,” but I hold in my hand a copy of an August 1990 article from Ila Filastin, an Islamist publication, that reported them. You can also find Ghannouchi statements going as far back in support of democracy and Islamic reformation.

Who’s the real Rachid Ghannouchi? Perhaps now, after a couple of Tunisian elections impressive for their orderly execution, and on the eve of a presidential vote Sunday, this divisive figure of Arab politics can be judged just by what he has done. Mr. Ghannouchi, who is not on the presidential ballot, is the one person most responsible for fostering the introduction of an Arab democracy, however fragile, in this North African nation—the exception in a region torn apart by the violent upheavals of the past four years.

Ponder the picture of the bearded leader of the Islamist Nahda (Renaissance) Party last month calling to congratulate the head of the rival secular bloc for its victory in Tunisia’s parliamentary elections. It was as if everybody had won. Hardly. Nahda—which in 2011 secured a larger share (37%) of the country’s first free vote than the Muslim Brotherhood ever won in Egypt—had finished a surprise second in Tunisia’s second free election. With no apparent bitterness, Mr. Ghannouchi offered to join a government of national unity with the victorious Nidaa Tounes (Tunisian Call), which brings together remnants of the old secular and repressive regime ousted in early 2011. As promised, to calm secular nerves in Tunisia, Nahda isn’t running a candidate in this weekend’s presidential elections. Mr. Ghannouchi keeps repeating that without consensus and power-sharing, no formerly authoritarian country can build a democracy.

The road to here was bumpy, and the journey remains daunting. An Islamist insurgency in Tunisia is being aided by arms from neighboring Libya. As many as 3,000 Tunisians have reportedly joined the Islamic State terrorist forces in Syria and Iraq—more than from any other country. Islamists assassinated two prominent secular politicians last year, nearly ending the experiment in consensus politics.

In the aftermath of those killings, massive protests blamed the ruling Nahda Party, not unjustly, for being too soft on violent extremism. Mr. Ghannouchi didn’t dig in—he turned conciliatory. He pushed Nahda, over the objections from insiders, to step aside for a technocratic government. He worked out a constitutional compromise with Beji Said Sebsi, an 87-year-old politician who served the old regime in various roles and now runs the Nidaa Tounes Party, winner of last month’s parliamentary election. The Tunisian constitution adopted this year is remarkably liberal.

When I saw him this fall in New York, Mr. Ghannouchi brought up the common charge against Islamists and democracy: One vote, one time, never again. (See Hamas in Gaza and Iran’s theocrats.) Yet Nahda gave up power last year and has now accepted the results of a free election. If you can win once and lose once, his party can feel confident it can win again. Like in a normal country.

Mr. Ghannouchi seems to have digested this basic lesson. But have the people of the ancien, undemocratic regime?

If Mr. Sebsi, the leading presidential candidate in Sunday’s vote, wins the election, his party will control the executive and legislative branches. Given its roots in the authoritarian past, there will be a temptation to slide back into the old ways. “We have a great constitution but it’s still only on paper,” says Radwan Masmoudi, who runs Tunisia’s Center for the Study of Islam and Democracy. “The culture of democracy is young and weak.”

We’re often told that the clash in the Muslim world is between Islamism and liberalism. This is misleading. In reality, the fight is authoritarianism or violent chaos versus freer and peaceful politics. Syria, Libya and Iraq are living through the chaos, and the rest of the region is ruled by strongmen. Some come in the military uniform of Egypt’s President Abdel Fattah Al Sisi. In the fine suits of Bashar Assad or the thawbs of Saudi royals. Or in the clerical garbs of Tehran’s mullahs. Then there’s the something-in-between of Turkey’s Recep Tayyip Erdogan.

The lesson from Tunisia for the political future of the Arab lands: Don’t pay attention to the labels. What matters is the all-too-human capacity to adapt and see a better way to self-government. “Yes, God has given us his word and his commands, but he has not put anyone to represent him on this earth,” says Mr. Ghannouchi, explaining his Islamist take on representative rule. “This is why democracy is the best way to decide how to rule ourselves.”

You don’t have to know the true content of Mr. Ghannouchi’s heart. It should be enough that his country is the one Arab nation with some guardrails now in place to protect it from the vices and stupidities that might issue from any mortal politician, no matter his religion.