(Adds dropped word in paragraph 10)
By David Brunnstrom
BAGRAM, Afghanistan, June 1 (Reuters) - U.S. Defense Secretary Chuck Hagel said on Sunday he hoped a prisoner-exchange deal between the United States and the Taliban that freed a U.S. soldier held for nearly five years might lead to breakthroughs in reconciliation with the Afghan militants.
Army Sergeant Bowe Bergdahl, the last POW from America's waning Afghan war, was handed over to U.S. special forces in Afghanistan on Saturday in a dramatic swap for five Taliban detainees who were released from Guantanamo Bay prison in Cuba and flown to Qatar.
"Whether that could lead to possible new breakthroughs with the Taliban, I don't know. Hopefully it might," Hagel told reporters traveling with him on a visit to Afghanistan, where the United States has been fighting Taliban guerillas since driving the group from power in 2001.
Asked if the freeing of the prisoners might encourage the Taliban to kidnap more U.S. troops, Hagel replied: "This was a prisoner of war exchange ... our focus was on the return of Sergeant Bergdahl and maybe this could provide some possible new bridge for new negotiations."
Hagel said the United States had continued to look for opportunities to get Bergdahl back, even after the insurgents broke off talks in 2012.
"We had been ... working to find ways to open up some possibilities with the Taliban to try to get Sergeant Bergdahl back. This didn't just start. This has been an ongoing effort that our government has been involved in at every level ... We found some openings ... that made sense to us."
Hagel said a key factor was the willingness of the Emir of Qatar to take the lead in efforts to reach a deal.
"The timing was right, the pieces came together," he said.
Bergdahl's release came days after Obama outlined a plan on Tuesday to withdraw all but 9,800 American troops from Afghanistan by the end of the year and the rest by 2016, ending more than a decade of U.S. military engagement.
A U.S. official said he did not see a link between the agreement and Obama's announcement. "This predates the decision on troops. This is just a matter of this coming together with the help of the Qataris and the Taliban realizing that we were serious."
Hagel, a veteran of the Vietnam War, called Bergdahl's release, "a happy day".
"In an operation like this, where there is always uncertainty, where there is always danger you prepare for all eventualities," he said.
The special forces involved "took every possible precaution ... through intelligence, surveillance, reconnaissance" and by ensuring the sufficient assets, including helicopters, were in the right locations, he said.
"Fortunately ... no shots were fired, there was no violence. It went as well, not only as we had expected and planned but I think as well as it could have."
Hagel said Afghan president Hamid Karzai had not been informed in advance.
"This ... had to be very closely held. Only very, very few people knew about this operation. We couldn't afford any leaks anywhere, for obvious reasons," he said.
Hagel noted that Obama had declared his intention to close Guantanamo and he, as defense secretary, was examining the cases of the remaining inmates held there.
"Some are more advanced than others in that process," he said, adding that the key factors were having states willing to accept prisoners and the assurances that could be given that they would not to return to the battlefield.
Hagel said on Wednesday he would make a decision "fairly soon" about six Guantanamo detainees Uruguay had offered to take. (Editing by Alex Richardson)