President Joe Biden will remove all US troops from Afghanistan before this year's 20th anniversary of the September 11 attacks, ending America's longest war around five months later than planned, a US official said.