Defending champion Spain will play its opening World Cup game against the Netherlands, a repeat of the ill-tempered 2010 final.
Friday's draw threw up plenty of other intriguing match-ups. The United States was drawn in the toughest group with Germany, Portugal and Ghana.
Brazil starts its campaign for a sixth World Cup title with an opener against Croatia. Mexico and Cameroon were also drawn in the host nation's group.
Bosnia-Herzegovina, the only World Cup newcomer among the 32 teams, plays its opener against Argentina. Iran and Nigeria were also drawn in that Group F.
Colombia, Greece, Ivory Coast and Japan are in Group C, with Uruguay, Costa Rica, England and Italy in Group D.
One of the easiest groups on paper looked to be E, with Switzerland, Ecuador, France and Honduras.
Russia, host of the next World Cup, is in Group H with Belgium, Algeria and Korea.