The United States will face England and Iran in Group B at the World Cup finals while Spain will take on Germany in a clash of former winners in Group E.
Holders France will meet Denmark and Tunisia in Group D while the tournament will kick off on November 21 with hosts Qatar playing Ecuador.
For the US, the draw pits them against their former colonial rulers England and the Iranians, a country they have had long-running political disputes with.
The US faced Iran at the 1998 World Cup in France, losing 2-1.
Group G was one of the toughest, pitting five-time World Cup winners Brazil against Serbia, Switzerland and Cameroon.
The draw came after a 45 minute musical and video show as FIFA president Gianni Infantino promised the event would "simply be the best tournament ever".
The decision in 2010 to hand the hosting rights to Qatar was heavily criticised and there has been intense scrutiny of the human rights situation in the country.
Qatar's Emir Sheikh Tamim bin Hamad al-Thani welcomed the guests who included national team coaches, World Cup-winning players and football officials all waiting to discover the group stage match-ups during a ceremony presented by British actor Idris Elba and broadcaster Reshmin Chowdhury.
The tournament will run from November 21 to December 18 -- the first time soccer's top prize has been competed for in the Middle East and there was a distinct Arabian feeling to the show.