IRAQ’S BEST days in the past decade have been its elections, and somewhat surprisingly, Wednesday was one of them. Though the country is sliding into civil war — the United Nations reported that 750 people were killed by political violence in April — about 12 million people went to the polls to vote in the first parliamentary elections held without the presence of U.S. troops. The turnout, a reported 58 percent, was higher than in most U.S. presidential elections. Iraqis remain eager to practice democracy, even if their rulers are not.

Unfortunately, the voting appears more likely to accelerate than arrest Iraq’s descent into the mass bloodshed and disintegration that has overtaken neighboring Syria. Prime Minister Nouri al-Maliki , in office eight years, appears confident that his Shiite party will win a plurality of votes, allowing him to continue what has been an increasingly authoritarian and sectarian rule. With heavy backing from Iran, Iraq’s strongman hopes to corral dissident Shiite parties and perhaps Kurds into a new coalition, though that process could take months. Even if he fails, Mr. Maliki’s opponents may lack the muscle to remove him from office.

The Baghdad government and its U.S.-trained Army, meanwhile, are losing control over much of the country. Mr. Maliki built support among Shiites before the election by launching a military campaign against Sunni tribes in Anbar province; the result was the takeover of Fallujah by al-Qaeda and waves of bombings against Shiites in Baghdad. Without U.S. support, the army appears to lack the means to recapture Fallujah and other Sunni-populated areas, though Mr. Maliki, like Syria’s Bashar al-Assad, has resorted to using Iranian-backed Shiite militias. The prosperous, autonomous Kurdistan region, with its own oil reserves, has become a de facto independent state.

At least some of this trouble could have been avoided had the Obama administration managed Iraq better. Eager to withdraw all U.S. forces during his first term, Mr. Obama backed Mr. Maliki following the 2010 election even after it became clear his coalition had been brokered by Iran. Just as the absence of U.S. military advisers and trainers has contributed to the Iraqi army’s loss of effectiveness, the absence of U.S. political brokers — generals as well as diplomats — has accelerated the sectarian crumbling of the American-built democratic system.

Most Americans may share Mr. Obama’s readiness to dismiss this mess. But Iraq’s failure will do more than reverse the gains won by the hundreds of thousands of Americans who served there over nine years. Al-Qaeda and its affiliates are close to consolidating control of a wide swath of territory extending across western Iraq and northern Syria. U.S. intelligence chiefs have told Congress that the extremists, who have attracted thousands of recruits from around the Middle East and Europe, aspire to launch attacks against the U.S. homeland. The Obama administration may hope that a new Iraqi government can eliminate this threat; the odds are that it will not.