An army spokesman said Specialist Ryan Anderson was detained at Fort Lewis, Washington state, on Thursday.
Lieutenant Colonel Stephen Barger added that charges of "aiding the enemy" were pending.
Anderson is a member of the Washington National Guard's 81st Armored Brigade, which was preparing to deploy to Iraq.
"Specialist Anderson will be held at the Fort Lewis regional correction facility and the criminal charges (are) of aiding the enemy by wrongfully attempting to communicate and give intelligence to the al-Qaida terrorist network in violation of the Uniformed Code of Military Justice," Barger said.
Anderson was taken into custody by army and federal law enforcement authorities, but has not been formally charged as yet.
11 September attacks
The soldier, who joined the National Guard in May 2002, was reported to have attempted to make contact with al-Qaida through internet chat rooms.
"The criminal charges (are) of aiding the enemy by wrongfully attempting to communicate and give intelligence to the al-Qaida terrorist network in violation of the Uniformed Code of Military Justice"
Lieutenant Colonel Stephen Barger
"That would be a matter for the investigation," said Barger, "I couldn't get into any specifics."
He added: "He will have the opportunity to appear before magistrate's court. That's the next phase."
The US blames Usama bin Ladin's al-Qaida for a number of attacks against American interests over the past decade.
In particular, the White House says al-Qaida was behind the 11 September 2001 attacks on New York and Washington that killed around 3000 people.
Although the Islamist network has expressed support for the operation, it has yet to claim clear responsibility for it.