By Roberta Rampton and Jeff Mason

WASHINGTON (Reuters) - Reversing policy on Afghanistan, President Barack Obama announced on Thursday he will prolong the 14-year-old U.S. military engagement there, effectively handing off the task of pulling out troops to his successor.

Calling it a "modest but meaningful" adjustment to winding down the American presence in Afghanistan, Obama said Afghan forces were not yet as strong as they needed to be given a "very fragile" security situation and the United States will maintain a force of 9,800 through most of 2016.

Obama had previously aimed to withdraw all but a small U.S.-embassy based force in the capital, Kabul, before he leaves office in January 2017. Under the new plan, troops will be drawn down to 5,500 starting sometime in 2017 and will be based at four locations - Kabul, Bagram, Jalalabad and Kandahar.

Obama has been under pressure from his military advisers, Republicans, and a bipartisan group of national security experts to keep U.S. forces in Afghanistan, particularly as Afghan forces have struggled in assaults from Taliban militants, who briefly took over the northern city of Kunduz.

On Thursday, Republican critics warned against rushing to cut troops in 2017. John McCain, chairman of the Senate Armed Services Committee, said the proposed 5,500 U.S. troops would be inadequate to handle both counter terrorism missions and training and advising Afghan troops.

McCain said it was unlikely that senior military leaders and commanders on the ground had recommended this force level, adding, "It would have been far better to halt all further troop withdrawals and allow President Obama's successor to determine what is warranted based on conditions on the ground."

At the Pentagon, Defense Secretary Ash Carter rebuffed criticism from McCain and others over the planned 5,500 troops.

"We do look at it as enough. We did a lot of homework on this," Carter told reporters. Pentagon spokesman Peter Cook said U.S. allies would also offer a significant contribution of forces but declined to offer details.

Story continues

Obama, a Democrat, has faced steady criticism from Republicans on security issues as he has wound down the wars in Iraq and Afghanistan that he inherited when he took office in 2009.

In his remarks on Thursday, he focused on the rationale for delaying a complete withdrawal, telling Americans that he did not support the idea of "endless war" but arguing Afghanistan's stability is vital to U.S. security. Troops would remain out of combat roles, focused on training and advising Afghan forces, and ensuring that any al Qaeda remnants do not threaten U.S. security, he said.

"This isn't the first time those adjustments have been made. This probably won't be the last," Obama said, defending the change of course. "I suspect that we will continue to evaluate this going forward, as will the next president."

The U.S.-led coalition in Afghanistan ended its combat mission at the end of 2014, and since then Afghan troops have been in charge of the country's security, with help from U.S. and NATO troops.

U.S. military and administration officials have been discussing a slower withdrawal timetable since the March visit to the White House of Afghan President Ashraf Ghani and Chief Executive Abdullah Abdullah. Obama said he spoke to the leaders on Wednesday.

Ghani has been more supportive of the U.S. presence than his predecessor, Hamid Karzai, who left office last year. Obama stressed that he viewed Washington as having a solid partner in the Afghan president.

Ghani praised Obama's decision, saying the assistance would help his government's forces fight "a ruthless and cunning enemy."

U.S. troops were first sent to Afghanistan by Obama's predecessor, George W. Bush, soon after the Sept. 11, 2001, attacks on the United States, in a U.S.-led effort to destroy al Qaeda and to oust the then-ruling Taliban that had sheltered the militant group.

GUARDED SUPPORT FROM CONGRESS

Republican Speaker John Boehner said the U.S. House of Representatives would review the decision but said Obama was right to give up on "arbitrary political deadlines" for the troop drawdown.

Reaction from Democrats, who have pushed for an end to U.S. involvement in the country, was muted. Democratic House Leader Nancy Pelosi stopped short of saying she supported Obama, noting in a statement that she looked forward to "a high-level briefing" on the issue.

Thursday's announcement means the Afghan baton will now be passed to whoever wins the November 2016 U.S. presidential election.

Jeb Bush, one of a large array of Republican candidates, welcomed the move but said Obama should listen to his military commanders about further steps.

There was no word yet from Hillary Clinton, Obama's former secretary of state and the front-runner in a smaller field vying to be the Democratic nominee.

A bipartisan group of security experts had urged Obama in a report this week to keep troops in Afghanistan.

Obama's desire to withdraw from the country before leaving office was understandable but he made the right call by changing his mind, given developments on the ground, said one of the authors, James Cunningham. Cunningham was ambassador to the Afghanistan from 2012 to the end of 2014 and is now with the Atlantic Council think tank.

"The question has always been whether that's a realistic goal, and whether it will create a dangerous situation if we actually do that," he said in an interview.

NATO Secretary General Jens Stoltenberg said the decision "paves the way for a sustained presence by the NATO alliance" and said decisions on its support would be made in coming weeks.

There are more than 6,000 non-U.S. forces in Afghanistan as part of the "Resolute Support" mission.

Keeping 5,500 troops at four locations will cost about $14.6 billion per year, up from the estimated cost of $10 billion to keep a consolidated force at the Kabul embassy, officials said.

The U.S. State Department also announced a new Special Representative for Afghanistan and Pakistan: Richard Olson, a former ambassador to Pakistan.

(Additional reporting by Julia Edwards, Steve Holland, Phil Stewart, Patricia Zengerle and Lesley Wroughton in Washington, Petar Komnenic in Podgorica, Montenegro and Hamid Shalizi in Kabul; Editing by Frances Kerry)