Thursday’s election in Afghanistan is a critical early test of America’s new strategy in the war. It is a crucial challenge and opportunity for the United States, NATO, and our other allies, as well as the Afghan national government and army. Yet it is also a challenge and opportunity for the Taliban and al Qaeda. The stakes are much higher than who will be elected president of Afghanistan for the next five years.

The United States and NATO have had more than six months to prepare for Thursday. Additional troops from the U.S., U.K., and other allies have been sent to Afghanistan to help ensure a credible election day with the minimum possible violence and intimidation. Major campaigns have been launched to try to open parts of the country, like Helmand Province, from the grip of the Taliban to allow voting. The challenge is to pull off an election that has sufficient voter turnout in spite of the Taliban’s threats to be credible. An army of international observers and the media will be on hand to witness.

The opportunity is also present for a second chance. If the elections come off, despite violence and threats, and if the Afghan people judge them to be reasonably credible—not necessarily entirely free and fair, but legitimate and credible—the Afghan government and the NATO mission will have gotten an important boost of confidence and legitimacy they badly need. After almost eight years of drift, a newly elected government that is seen as legitimate offers a chance for President Obama’s strategy to go forward with an Afghan buy-in.

In NATO’s capitals an election also will buy time with European, Canadian, and American constituencies that are growing war weary. Politicians on both sides of the Atlantic will be able to point to something tangible as a sign of progress.

For Mullah Omar and the Taliban, the election is a chance to prove their strength and show who controls what parts of the country. The Taliban leader has promised to cut off the fingers of those who vote, and his fighters are trying to assassinate candidates, intimidate voters, and disrupt the process. Five years ago, Omar also denounced the election, but he was largely powerless to affect it. Now he will show his power.

But the Taliban also is challenged. It needs to show it is not just a Pashtun insurgency and that it can operate on a national scale like the Mujahideen operated when they fought the Soviets in the 1980s. This means disrupting the process in Tajik, Uzbek, and Hazari Shia towns and villages, not just in the Pashtun south and east.

The good news is this election has become a horse race. Six months ago it looked like President Hamid Karzai was going to coast to re-election. None of his opponents looked capable of a real challenge; indeed, it looked more like a coronation than an election. Karzai may still win in the first round, but Abdullah Abdullah and other candidates have given him a run for it. That alone should help make this election more credible. If there is a second-round runoff, all bets are off.

The bad news is so many things may go wrong. Not just the violence and terror that the Taliban and al Qaeda create, but the results may be challenged on the basis of fraud and ballot stuffing. The losers may refuse to accept the outcome even if it is reasonably fair. Karzai’s collection of endorsements from warlords like Abdul Rashid Dostam—a man who began his career fighting for the Soviets and has switched sides more times than can be counted—may be deemed unacceptable to most Afghans and play into the Taliban’s hands.

So the stakes are high for all the players in the Afghan drama. Next door, Pakistanis will be watching to see whether NATO or the Taliban look like winners—and calculate their own policies as a result. Islamabad’s calculation of the outcome is an important as any. It will have an impact on the Pakistani army’s assessment of NATO staying power, which is currently very low.

But first all the results need to come in and be analyzed carefully. Who was able to vote and where they did so will say a lot about the relative strengths of the combatants. It will be a map of strength and weakness for both sides. The “metrics” to measure Obama’s war—which many are calling for—will be in Thursday’s votes.