Brennan Linsley, File, Associated Press
In this June 27, 2006 file photo, reviewed by a U.S. Department of Defense official, U.S. military guards walk within Camp Delta military-run prison, at the Guantanamo Bay U.S. Naval Base, Cuba. President Barack Obama’s declaration that the U.S. is no longer at war in Afghanistan has given rise to new legal challenges from Guantanamo Bay detainees who were captured in that country, but say there’s no longer any legal basis to hold them.

WASHINGTON — President Barack Obama's declaration that the U.S. is no longer at war in Afghanistan has given rise to new legal challenges from Guantanamo Bay detainees who were captured in that country. They say there's no longer any legal basis to hold them.

In two cases, detainees are asking federal judges to consider at what point a conflict is over. They note that Obama last December announced that the U.S. "combat mission in Afghanistan is ending."

Courts have ruled the government may hold prisoners captured during a war for only as long as the conflict in that country continues.

The detainees say if the war in Afghanistan is over as Obama says, then their detention is unlawful.

The court challenges are the latest example of the legal wrangling tied to Guantanamo.