Air Force spokeswoman Major Beverly Mock said German police have the suspect in custody and that she could not release any further details on the victims until their next of kin have been told.
The men who died were based in UK, the Air Force said.
Two other people are said to have been injured in the incident and police have reportedly arrested a 21-year-old suspect from Kosovo.
The shots were fired at a bus carrying US military, police have confirmed, but the motive for the attack was not immediately clear.
US President Barack Obama said he was outraged by the attack.
The US would "spare no effort" in finding out how it happened, he said during a surprise appearance in the White House briefing room.
The gunman struck in front of terminal 2 of the airport, which is continental Europe's second-biggest.
German Chancellor Angela Merkel, speaking in Berlin, expressed sadness and said: "We have to do everything we can to find out what happened."
The airport is not far from Ramstein air base, the headquarters of the US Air Force in Europe, and the US has several other bases in the region.
A US military source told Sky News that crews travelling on buses at airports would not necessarily be armed.
"Everything happened on board the bus," police spokesman Juergen Linker told news agency AFP.