The impressive re-election victory scored by Turkey’s conservative Muslim ruling party is a tribute to the growing maturity of that country’s politics and an inspiration for the cause of democracy in the broader Muslim world.

Voters rightly rejected the claim asserted by the traditional military-secular establishment that there is any fundamental incompatibility between democracy and Islam. Instead, they rewarded a party that has given the country its most competent and successful government in recent decades. That is exactly how democracy is supposed to work.

Since the Justice and Development Party (known by its Turkish initials, AK) came to power almost five years ago, its market-oriented policies have promoted strong economic growth and helped bring runaway inflation back under control. In its pursuit of European Union membership, AK has also pushed through a series of legal reforms that have expanded human rights and brought Turkish law closer to European standards.

Those reforms have stalled in the face of opposition from generals and civilian nationalists and discouraging signals from the E.U. about Turkish membership. The Kurdish minority is still subject to discriminatory legal restrictions. So is the ruling party’s main constituency, observant Muslims.

The AK should use its huge victory to reinvigorate the drive for reforms, and not just for its Muslim supporters. But it still must be careful not to provoke a military leadership that sees itself as the guardian of secular nationalism and has been less than scrupulous about respecting electoral democracy. The AK, in contrast, has broadened its support by moving away from its original, narrowly Islamic roots. It is still a visibly Muslim party, but it is also a visibly democratic and tolerant party.

Turkey’s generals should heed the voters. Washington should continue to press Turkey’s case for E.U. membership. The example of a successful Muslim democracy can be a powerful weapon in the war of ideas against Islamic terrorism.