The White House has announced the expansion of the US military's role in Afghanistan to fight the Taliban, ratcheting up a 15-year conflict President Barack Obama had vowed to end.

Josh Earnest, Obama's press secretary, said on Friday that US forces will play a "more proactive" role in helping local troops "be more effective in the battlefield".

Earnest said US support will come in the form of "advice and assistance" to Afghan military, as well as "occasionally accompanying them in their operations".

Opinion: Ashraf Ghani's war strategy will fail

Afghan forces have struggled to contain the Taliban, which has carried out numerous attacks, including in the Afghan capital Kabul.

But Earnest denied that Obama is "restarting" the US combat role there, which ended in 2014.

At least 9,800 US forces have remained in an advisory role in Afghanistan since the start of 2015, and were only authorised to hit Taliban targets for defensive reasons, or to protect Afghan troops.

Defence Secretary Ash Carter said the order was issued to General Sean MacFarland, US commander in Afghanistan.

Al Jazeera's Rosiland Jordan, reporting from Washington DC, said the US defence department had wanted to carry out the plan for months.

"The concern about the resurgence of the Taliban has been growing in the Pentagon," Jordan said.

The plan also includes "strategic strikes" against the Taliban in order to weaken it, while shoring up the Afghan troops' ability to defend the country, she said.

As the "summer fighting season" comes in high gear, the US wants to make sure the Afghan military "would not be caught short", Jordan added.

Obama was elected in 2008, promising to end one of America's longest and most gruelling wars.

Has US foreign policy failed in Afghanistan and Iraq?

The first US troops arrived in Afghanistan 15 years ago, after the Taliban government refused to turn over Osama bin Laden, the mastermind of the September 11, 2001 attacks, and more than 2,000 US personnel have died in the ensuing war.

At the peak of the US deployment in Afghanistan, around 100,000 American soldiers were stationed across the country in March 2011.

The campaign to neutralise the Taliban has suffered multiple setbacks in the twilight of Obama's presidency.

More than 5,000 Afghan troops died last year alone, prompting Obama to indefinitely postpone the withdrawal of US troops.

Obama's latest Afghan decision would appear to push any brokered solution well beyond his presidency.