At the end of March, Turkey’s President Recep Tayyip Erdoğan suffered a major political defeat, including but reaching well beyond the elections involved. The voters of the nation sent the autocrat a courageous message of defiance.

A sizable majority has reelected opposition Mayor Ekrem Imamoglu by over 50% of the vote. This is a rerun of elections in 2019 where Imamoglu first emerged victorious.

The opposition Republican People’s Party, known as the CHP, won 36 of the municipalities of Turkey’s 81 provinces. A sizable proportion of the new mayors elected are women, an extremely important positive development.

Erdoğan is no longer the predictable political winner. He did narrowly win a third term as president last May, while his Justice and Development Party, known as AKP, in alliance with another party, secured a strong parliamentary majority.

In 2016, he personally turned back an attempted military coup, using social media to urge the people to resist. That showed courage as well as cleverness. A national state of emergency was declared. Police arrested citizens before the national elections for publicly criticizing Erdoğan.

An April 2017 referendum gave expanded presidential powers. Erdoğan and allies quickly declared victory after the voting, but their margin was narrow, with accusations of irregularities.

Turkey retains great strategic importance. First, the nation geographically spans Europe and Central Asia. Turkey can be a diplomatic bridge between Islam and the West. Turkey controls important sea and land shipping routes, including the Bosphorus Strait that channels Black Sea access.

Second, since World War II, Turkey has maintained good relations with European nations and the United States. Current tensions overshadow this important history.

Third, Turkey represents a unique marriage of firmly rooted Muslim religious and cultural attitudes with Western-style governmental and commercial institutions and practices. This draws on the nation’s Ottoman history, which combined religious and firmly secular outlooks.

In “Lords of the Horizon: A History of the Ottoman Empire,” Jason Goodwin notes that he writes “about a people who do not exist. The word ‘Ottoman’ does not describe a place. Nobody nowadays speaks their language. Only a few professors can begin to understand their poetry. ... (Yet) For six hundred years the Ottoman empire swelled and declined.”

Over the past four decades, Turkey’s economy has enjoyed reform and expansion. Growth was strong until recently, corruption and inflation were reduced and government red tape and bottlenecks eliminated.

Much of the credit belongs to reform Prime Minister and President Turgut Özal, who held office from 1983 to 1993. He was a close friend of President George H.W. Bush.

While Turkey has had rocky relations with the European Union, the NATO alliance benefits from the nation’s highly effective military. In the Korean and First Gulf Wars, Turkey was a significant military coalition partner. In Korea, Turkey’s military reconfirmed once again their well-deserved reputation for combat effectiveness. In Afghanistan, Turkey had top command responsibilities over the years.

Erdoğan’s autocratic behavior presents a challenge, yet modernization continues in Turkey. Opposition parties are established in parliament. Current economic weakness provides the political opposition opportunities, and undercuts regime support. As in other parts of the world, public pressure grows for a modern standard of living

During the Cold War, Washington worked with unattractive governments for good practical reasons. Similar considerations apply today.

Turgut Özal, along with Bush, deserves respect for mature leadership. Both had executive skill and personal integrity. In the future, their examples should guide Turks and Americans.

Arthur I. Cyr is the author of “After the Cold War” (NYU Press and Palgrave/Macmillan).