The injured soldiers, 24-year-old Andrew Wolfe and Sarah Beckstrom, 20, have come through surgery, but remain in a critical condition.
US Attorney for the District of Columbia Jeanine Pirro said the suspect, Rahmanullah Lakanwal, drove thousands of miles across the country from Washington state before the attack on Wednesday.
Lakanwal was shot by another soldier during the incident and was taken to hospital. US President Donald Trump said he was "severely wounded".