WASHINGTON – More than 17 years after the United States went to war in Afghanistan, the Supreme Court refused Monday to decide if prisoners detained that long deserve their freedom.

The high court declined to hear the case of Moath Hamza Ahmed al-Alwi, a Yemeni national imprisoned at the U.S. Naval Station at Guantánamo Bay, Cuba, since 2002. He claimed the basis for holding him any longer had "unraveled."

What made the case unique was the unprecedented duration of the conflict in Afghanistan compared to traditional wars, which al-Alwi's lawyers said could lead to "lifelong imprisonment."

They argued that the "relevant conflict has effectively ended" and that federal courts should play a role in determining that, particularly when prisoners remain detained years after they were picked up on the battlefield.

Associate Justice Stephen Breyer did not object to the court's decision against hearing al-Alwi's case but said the issue of long-term detention should be addressed in the future.

"Al-Alwi faces the real prospect that he will spend the rest of his life in detention based on his status as an enemy combatant a generation ago, even though today's conflict may differ substantially from the one Congress anticipated when it passed the (Authorization for Use of Military Force)," Breyer wrote.

There is little evidence that al-Alwi was a prominent fighter for al-Qaeda or the Taliban. He was picked up in Pakistan after the U.S. bombing of Afghanistan began. Since January 2002, he has been imprisoned at Guantánamo, which now houses only 40 prisoners.

The battle was named Operation Enduring Freedom at first, but by 2003 major combat had ended. In 2011, al-Qaeda leader Osama bin Laden was killed, followed by Taliban leader Mullah Omar in 2013. A new campaign, Operation Freedom's Sentinel, was launched to advise and train Afghan forces.

In January 2015, President Barack Obama declared that "for the first time since 9/11, our combat mission in Afghanistan is over." Today there are about 14,000 U.S. troops there, down from 100,000 at the peak of the war.

"The time for the court to impose limits on perpetual military detention has come," al-Alwi's lawyers said in court papers. "The conflict in Afghanistan has continued for more than 17 years, and Mr. al-Alwi has been imprisoned by the United States without charge or trial for nearly as long."

Justice Department lawyers told the court that al-Alwi joined the Taliban in 2001, stayed at al-Qaeda and Taliban safe houses, and attended a Taliban-affiliated training camp. They said he admitted to serving in a combat unit for most of that year.

"Petitioner does not now contest these facts," Solicitor General Noel Francisco said in court papers. "Nor does he contest that the United States remains engaged in active hostilities with the Taliban and al-Qaeda in Afghanistan."