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.