In all the turmoil of the Middle East, the most significant development of the year thus far may be the democratic election Iraq held on Saturday. It was competitive, fair and largely free of violence — a remarkable achievement for a country that until a few months ago was fighting a war against the Islamic State.

Unlike most people in the Middle East, Iraqis were able to cast a vote against their government and the reigning elite — and it looks as if many did just that. The surprise front-runner in early returns was an alliance led by nationalist cleric Muqtada al-Sadr, a longtime enemy of the United States — but also an adversary of Iran’s local clients.

Sadr, a Shiite cleric, is remembered in Washington for leading a bloody insurgency against U.S. troops more than a decade ago. He’s still calling for the removal of all American forces from Iraq, at a time when even some Shiite leaders close to Iran are saying they want them to remain to continue training Iraqi forces.

Yet Sadr has shifted politically:  Several years ago he formed an alliance with secular groups, including the Iraqi Communist Party, and has campaigned on a nonsectarian, corruption-fighting agenda aimed at Iran’s local proxies. When his supporters took to Baghdad’s Tahrir Square to celebrate his apparent victory in the capital and several other provinces, they chanted, “Iran is out, Baghdad remains free,” according to a report by Al Arabiya.

Much of the Iraqi vote has yet to be tabulated, and it’s too early to say what role Sadr might play in forming a new government. So far, the alliance of Hadi al-Ameri, a militia leader close to Tehran, is running second, while incumbent Prime Minister Haider al-Abadi, the U.S. favorite, is in third. The good news is that Iran’s most slavish and sectarian proxy, former Prime Minister Nouri al-Maliki, is running a distant fourth, just barely in front of the largest Kurdish party.

Weeks — or more likely, months — of negotiations will ensue, and for now there’s no telling who might head the next government or what its position will be on cooperation with the United States. Iran will be working hard to promote its interests, and the Trump administration ought to do the same. If it can summon the focus and diplomatic resources, there’s an opportunity to reinforce the incipient shift toward nonsectarian politics built around support for Iraqi sovereignty — including from Iran. That could take the country away, at last, from the internal warfare that has wracked it since the U.S. invasion — and which, with similar partisans, continues to devastate neighboring Syria.

Sadr has called for a secular government of technocrats who will respect the rule of law and civil society. That may not be entirely achievable, but it’s a goal many Iraqis clearly found attractive. That they were able to express themselves democratically is even more encouraging.

FROM AN EDITORIAL IN THE WASHINGTON POST