President Joe Biden says the September 11 attacks “cannot explain” why US forces should remain in Afghanistan 20 years later and that “it is time for American troops to come home” from the country’s longest war.

Mr Biden, in excerpts of a speech to the nation he plans later, says the US cannot continue to pour resources into an intractable war and expect different results.

The White House released the excerpts before the afternoon address when he plans to detail his timeline for a US troop withdrawal.

“We cannot continue the cycle of extending or expanding our military presence in Afghanistan hoping to create the ideal conditions for our withdrawal, expecting a different result,” Mr Biden says.

“I am now the fourth American president to preside over an American troop presence in Afghanistan. Two Republicans. Two Democrats. I will not pass this responsibility to a fifth.”

Mr Biden says he consulted with allies, military leaders, legislators and vice president Kamala Harris to help make his decision to withdraw all US troops by September 11, two decades after the deadliest attack on American soil.

He is emphasising that his administration will continue to support peace talks between the Afghan government and the Taliban and assist international efforts to train the Afghan military.

“It is time to end America’s longest war,” Mr Biden says.

“It is time for American troops to come home.”