Alexandra, Virginia - John Walker Lindh, an American captured by US forces during the war in Afghanistan, has agreed to plead guilty to aiding the Taliban fundamentalist movement and carrying explosives.

The plea deal was announced on Monday at a hearing at the US district court in Alexandria, Virginia, where Lindh's case is being heard.

The 21-year-old Californian, who was present in court, faces a maximum of 20 years in prison - 10 years for each charge - under the agreement.

Lindh had originally pleaded not guilty to a 10-count indictment charging him with conspiring with the Taliban and Osama bin Laden's al-Qaeda network, blamed by the United States for the September 2001 attacks on New York and Washington.

Lindh was caught in Afghanistan in late November last year while fighting with the Taliban and was transferred to US military custody on December 1.

It will be up to US district Judge T S Ellis to sentence Lindh.