TUNISIA SET the example for a mass uprising against an Arab dictator early this year, and now it has taken a big step toward creating a model for a transition to democracy. On Sunday the country held the most free vote in its history — and one of the best in the history of the Arab Middle East. A constituent assembly was chosen to form an interim government and write a new constitution.

Participation was overwhelming, orderly and often joyful; foreign observers said it was one of the cleanest elections they had witnessed. For Egypt, Libya and other countries whose first democratic votes are still ahead, Tunisia offered proof that a safe and fair election can be held a few months after decades of dictatorship.

On Monday, the country’s leading Islamic party claimed victory — and that, too, could prove a positive example. The Ennahdha party, which was banned under the regime of Zine el-Abidine Ben Ali, said it had won at least 30 percent of the overall vote — and authorities said that it had captured half of the seats reserved for Tunisians living abroad. The party benefited from superior organization in a country where a bewildering array of secular parties are competing. The Muslim Brotherhood and other Islamic movements in Egypt, which has scheduled elections for the end of November, will have the same advantage.

Ennahdha, however, has repeatedly said that it is not seeking to monopolize power nor to impose a fundamentalist agenda. Its leader, Rachid Ghannouchi, who spent decades in Britain as an exile, has spoken of modeling his party on the mildly Islamist AKP party of Turkey; he has pledged to support women’s rights. Ennahdha is likely to form a coalition with secular parties, two of which appear to have finished second and third in the voting.

Mr. Ghannouchi’s promises must still be tested. But the rise of Islamist parties is inevitable in a democratic Middle East; what is crucial is that these parties forswear violence and accept the rules of democracy and human rights. So far Tunisia’s largest Islamic movement has done that. If its success is accepted by secular Tunisians and by Western democracies, its moderate model should get a boost in Egypt and Libya.

Egypt’s ruling military council, meanwhile, would do well to imitate some of the procedures that made Sunday’s vote a success. Tunisia accepted more than 14,000 domestic and foreign observers, meaning that every ballot box was watched by an independent auditor. It adopted anti-fraud measures such as inking the fingers of voters. Egyptian authorities have resisted such basic safeguards; they should be pressed harder to reconsider.