WASHINGTON — The United States believes Afghanistan has time to develop a reliable counterterrorism force before the end of 2016, when U.S. troops are due to withdraw under plans unveiled on Tuesday, the top U.S. military officer told Reuters.

President Barack Obama announced plans to leave 9,800 American troops in Afghanistan at the start of next year, down from some 32,000 now. By the end of 2015, that U.S. presence would be reduced by about half.

The forces, focused on advising Afghans and counterterrorism assistance, would gradually shrink to a smaller embassy presence by the end of 2016.

Gen. Martin Dempsey, chairman of the U.S. Joint Chiefs of Staff, said Pakistan and Afghan military chiefs had expressed appreciation and relief at the decision to keep thousands of U.S. forces in the country in 2015 and into 2016, ending months of uncertainty.

“The Afghan chief of defense, when I told him of the decision … immediately said: ‘Thank God,’” Dempsey said in a telephone interview as he flew to the United Arab Emirates.

He said Afghan army Chief of Staff General Sher Mohammad Karimi said the decision would allow his country to “feel as though we can get about the business of governing ourselves” secure in the knowledge of continued U.S. support.

“My Pakistani counterpart, the first words out his mouth was that he was deeply relieved. He too felt that the certainty was important, not only for Afghanistan but for the region,” Dempsey said, referring to Pakistan’s Gen. Rashad Mahmood.

Obama’s White House Rose Garden announcement prompted criticism from Republicans that the hard-fought gains made against the Taliban could be lost in much the same way that sectarian violence returned to Iraq after the U.S. withdrawal.

But Dempsey said he believed the message that America was heading to a normalization of relations with Afghanistan would “resonate quite favorably both in Afghanistan and regionally.”

“The notion of an enduring commitment but also that we don’t intend to be … in the day-to-day lives of Afghans the way that we have been in the past — I think that actually will resonate quite positively,” Dempsey said.

Dempsey said the decision to keep the 9,800 forces there past 2014 would give the next Afghan government time to “get its legs under it by not having to worry about our ultimate transition — while they’re trying to transition themselves.”

Dempsey saw some U.S. counterterrorism assistance even in 2016 and said the U.S. intent was to work regionally and with partners to address the future threat.

Noting the United States was already in a support role, Dempsey expressed confidence in the ability of Afghan forces following the military’s drawdown to a normal embassy presence with a security assistance office in Kabul, as was done in Iraq.

“What we’re trying to do with Afghanistan is develop a credible and reliable and capable (counterterrorism) partner so that we don’t have to do this ourselves,” he said.

“And we think with the time available in this decision, that we will be able to align that objective with the resources available, and with their development, to accomplish that objective.”

Obama’s long-awaited announcement was conditional on Afghanistan signing a bilateral security pact with Washington.

The two leading candidates in Afghanistan’s presidential race have both pledged to sign the pact quickly if elected in the second round of voting set for June 14.