Shihri was captured in Afghanistan in December 2001 and spent nearly six years as a prisoner at Guantanamo. He was released to the custody of the Saudi government as part of a rehabilitation program for militants. In 2008, however, he decamped for Yemen and helped to revive al-Qaeda’s organization there.The Bush administration released him. There's better detail in the UK Telegraph:
The Saudi was among the last survivors of al-Qaeda's pre-September 11 generation. Shihri trained in a camp in Afghanistan under bin Laden's guidance as early as 2000, before fleeing the US onslaught that followed the terrorist attacks on New York and Washington.
He was arrested while trying to cross the border into Pakistan in December 2001. After two months in Pakistani custody, Shihri was handed over to the US and consigned to a prison cell in Guantánamo Bay for six years.
When the Bush administration tried to reduce the number of inmates inside this bitterly controversial detention centre, Shihri was released in 2007 and sent back to his home country, Saudi Arabia.
Here, the authorities placed him on a course designed to rehabilitate even the most hardened al-Qaeda operatives. The kingdom has trumpeted the alleged success of this scheme, which often allowed its beneficiaries to walk free if they recanted.
Shihri appears to have been released in 2009, whereupon he immediately crossed into neighbouring Yemen and joined AQAP, rising to occupy its second highest position.