WASHINGTON — Afghanistan’s presidential election on Saturday gives the U.S. a new chance to fix relations with Kabul, which are in deep discord after more than 12 years of war and repeated fallings-out between the White House and Afghan President Hamid Karzai.

While many Americans have given up hope that Afghanistan can ever prosper in peace, tens of thousands of Afghans, hoping for change, are flocking to campaign rallies across their impoverished country, which continues to face a stubborn insurgency.

By all accounts, there will be fraud and violence — no one knows how much to expect. But if the election is seen as credible and legitimate in the eyes of the Afghan people, it will signal a chance for the United States to reset U.S. relations with a country where at least 2,176 members of the U.S. military have died and billions of tax dollars have been spent.

“It will be the start of a new chapter in our relationship — one where I hope we can get beyond focusing so much on one personality and the challenging aspects of that personality to a relationship that really is based on a number of profoundly shared strategic interests,” said Michele Flournoy, undersecretary of defense for policy between 2009 and 2012. But corruption is a major U.S. concern.

Karzai was brought to power in the wake of the 2001 U.S.-led invasion. In recent years, he has lashed out at the United States, saying it has not brought peace to his country, only never-ending violence that has left tens of thousands of Afghan citizens dead.

Relations between Karzai and the United States hit rock bottom late last year when the Afghan leader refused to sign a bilateral security agreement that sets the parameters for up to 10,000 troops to stay in Afghanistan after the NATO combat mission ends this year. The troops staying on would train, advise and assist Afghan security forces and conduct counterterrorism missions.

All candidates seeking to be Karzai’s successor have said they would sign the security agreement. Karzai himself apparently does not want his legacy to include a commitment to allow the deployment of international troops in his country any longer.

“It all turns to trust, and between me and America, there is not very good trust,” Karzai told a gathering late last year of 2,500 Afghan elders who urged him to approve the document. “I don’t trust them and they don’t trust me. The last 10 years has shown this to me. I have had fights with them and they have had propaganda against me.”

The White House will continue to hear that complaint — a “thorn in the side of Mr. Karzai” — from the newly elected president, said Omar Samad, former Afghan ambassador to Canada and France and a fellow at the New America Foundation in Washington.

He said the new Afghan president will ask the U.S. and the international community to deal with the “real issue of terrorism and radicalism in the region, and especially what is happening and what exists beyond our borders — the safe havens and the role that Pakistan can play.”

That complaint, Samad said, will likely require the U.S. to come up with a new strategy.

So far, U.S. officials claim they have taken a hands-off approach to the election and have refrained from publicly backing any of the candidates. And with the possibility of a runoff election, it could be several months before a new Afghan leader takes office.

Unless there is a major upset, President Obama will be dealing with one of the three front-runners: Ashraf Ghani Ahmadzai, a former finance minister and former World Bank employee; Abdullah Abdullah, Karzai’s leading opponent in the fraud-stained 2009 election; and Zalmai Rassoul, former foreign minister and national security adviser to the Karzai government.

The election could help rebuild bipartisan consensus in the U.S. to keep supporting Afghanistan, said Stephen Hadley, former President George W. Bush’s national security adviser. The new Afghan president should visit Washington, thank the American people for their years of support and outline his vision for Afghanistan and how he wants the U.S. to help, Hadley added.

A stable and acceptable political transition is “critical to sustaining international support for Afghanistan,” White House press secretary Jay Carney said Monday.

Millions of dollars of U.S. aid, which a war-weary Congress must approve, is at stake in the election and will be a key element of U.S. Afghan policy going forward. If the U.S. wants to honor its pledge to continue assisting Afghanistan, the president will have to convince lawmakers, who regularly point out endemic corruption in Afghanistan and complain about U.S. taxpayer money that has been stolen or gone missing.