The US Congress on Wednesday voted to set up a commission to assess the failures of the 20-year war in Afghanistan following the Taliban's victory.
The commission was part of a $768 billion annual defense package passed by the Senate 89-10 after similarly overwhelming approval last week by the House of Representatives.
President Joe Biden, who controversially pulled out US troops in August to end America's longest war, is expected to sign the National Defense Authorization Act.
The Commission on Afghanistan will include 16 members appointed by the two major parties and was given a deadline to issue an initial report within a year of its first meeting, and a final report within three years.
"The Commission shall conduct a comprehensive assessment of the war in Afghanistan and make recommendations to inform future operations with tactical and strategic lessons learned, including the impact of troop increases and decreases and date-certain deadlines," the legislation said.
President Barack Obama poured tens of thousands of troops into Afghanistan after taking office in 2009 but later withdrew most of them.
The administration of his successor Donald Trump negotiated a deal with the Taliban that set a May 2021 timeline for US troops to leave.
The commission will also look at George W. Bush's launch of the war as well as US policy on Afghanistan before 2001, when the September 11 attacks triggered the US invasion that overthrew the Taliban's draconian earlier regime.
The National Defense Authorization Act also renewed strong congressional support for Taiwan amid rising tensions with China, which claims the self-governing democracy as part of its territory awaiting reunification.
The act calls on the United States to develop Taiwan's asymmetric defense capabilities and to invite the island to take part in 2022 in the Rim of the Pacific exercise, major US-led drills that are held every two years around Hawaii.
The bill boosts US defense spending from last year by $28 billion, most of the increase not requested by the Biden administration.
It includes a 2.7 percent pay raise for both military servicemembers and civilian workers at the Defense Department.
Amid intense polarization in Washington, the bill sidestepped several controversial issues including calls to impose sanctions over the Nord Stream 2 pipeline between Russia and Germany and to repeal the 2002 authorization of the invasion of Iraq.