"None of us wanted an easy group," Mexico goalkeeper Guillermo Ochoa said. "If you're playing the World Cup, you want to face the best. And if you want to reach the final, you have to play great matches.
"Spain, which eliminated Portugal in the last 16 on the way to winning its first World Cup in 2010, will open against the European champions on June 15 in Sochi.
Group B also includes Morocco and Iran.Iceland, the country with the smallest population of the 32 World Cup teams, was drawn with Argentina, Croatia and Nigeria in Group D.
Another newcomer, Panama, will take on England, Tunisia and Belgium in Group G.
Peru, the last of the 32 teams to qualify for Russia, is in Group C with 1998 champion France, Australia and Denmark.
The only group without a former World Cup champion is Group H, which is made up of Poland, Senegal, Colombia and Japan.
Russian President Vladimir Putin opened the draw ceremony at the Kremlin, seven years after landing the hosting rights.
Putin urged fans to visit and enjoy his "big and multi-faceted" country, a rallying cry which follows concerns about racism and hooliganism.
"We will do everything to make it a major sporting festival," Putin said, looking forward to a World Cup of "friendship and fair play, values that do not change with time."
The Olympic doping scandal surrounding Russia hung over the final countdown to the draw. Russian Deputy Prime Minister Vitaly Mutko, who is the head of the World Cup organizing committee, defended himself against accusations that he helped to orchestrate state-sponsored doping at the 2014 Sochi Olympics.
"Nowadays everyone is trying to make some kind of axis of evil out of us, just because we're a great sporting power," Mutko said.The International Olympic Committee executive board will decide on Tuesday whether to ban Russia from the upcoming Pyeongchang Olympics.
FULL WORLD CUP DRAW
GROUP A: Russia, Saudi Arabia, Egypt, Uruguay
GROUP B: Portugal, Spain, Morocco, Iran
GROUP C: France, Australia, Peru, Denmark
GROUP D: Argentina, Iceland, Croatia, Nigeria
GROUP E: Brazil, Switzerland, Costa Rica, Serbia
GROUP F: Germany, Mexico, Sweden, South Korea
GROUP G: Belgium, Panama, Tunisia, England
GROUP H: Poland, Senegal, Colombia, Japan.