Iran was drawn in Group F alongside Argentina, reigning African champions Nigeria and newcomers Bosnia-Herzegovina, and will open their fourth campaign in the final stages of the World Cup on June 16.
The reaction in Iran was mixed, with some football-mad Iranians embracing the first-ever chance to play Argentina, and some even expressing ambitious hopes of beating the star-studded former World Cup champions.
But it was a different story online and particularly on Facebook, which many are able to access despite it being blocked in Iran under a systematic filtering of the Internet mechanism.
Several thousand derogatory remarks were left on Messi's Facebook page, many in Persian, trashing the 26-year-old superstar, winner of four FIFA Ballons d'Or -- the world player of the year.
Some made fun of the fact that Messi means "of copper" in Persian.
"Messi, you are made of copper. Even if you were out of gold, you could not do a damn thing" against Iran, said one commentator.
The remarks sparked a strong reaction by others who expressed support for the Barcelona man, and even apologised for the actions of their compatriots.
"As an Iranian, I want to apologise to you. Iranian people are not like that at all," said Ali in a post in English.
Iran's football federation also expressed regret, as did several Iranian national players.
Messi was not the only target; Brazilian model Fernanda Lima, a presenter at the draw, also drew a backlash for her attire.
Her revealing gold dress and matching heels was deemed inappropriate by the standards of the Islamic republic, where women are obliged by law to cover their hair and most of their body.
The draw ceremony was planned to be broadcast live in Iran with several hours of promo inviting fans to tune in to state television.
But every time Lima appeared in the shot, state television cut the live footage, provoking jokes by Iranian broadcast presenters navigating the draw in Persian.
Afterwards a storm of Persian comments were directed at Lima's Facebook page, with many Iranians leaving insulting remarks.
The ISNA news agency said the insults had blackened Iran's image ahead of the World Cup, while Hassan Beheshtipour, an Iranian analyst, attributed the issue to deep social dilemma.
"This is caused by social frustrations and a sort of inner contempt feeding a desire to object to anything," Beheshtipour said on his weblog.
But instead of "objecting to the state television's censorship ... they protest her dress, which is suitable for Brazil's spring weather", he said.
Some Iranians meanwhile, seeking to mitigate the damage, created a page on Facebook entitled "Iranians Apologise to Fernanda Lima and Leo Messi", which has so far attracted nearly 20,000 fans.
Online insults appears to be becoming a trend in Iran, home to a young and educated population.
In early November, Iranians took to the page of French Foreign Minister Laurent Fabius lamenting his purported role in scuttling a landmark nuclear deal in talks between Iran and world powers.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)