Now the pair have come face to face in Doha, according to Qatar's 2022 World Cup organising committee.
Barcelona are in Qatar to play a friendly against Al Ahli on Tuesday and Ahmadi will walk out on to the pitch with Messi.
"The image the world wanted to see," tweeted the Supreme Committee on Tuesday. "The six-year-old boy who dreamed of meeting his hero, #Messi, finally comes true."
Ahmadi, who comes from the Jaghori District, in the eastern Ghazni province of Afghanistan, was forced to flee the country to Pakistan in May.
Murtaza was finally identified as the boy in the picture after his uncle, Azim Ahmadi, an Afghan living in Australia, put BBC Trending in touch with his brother, Arif - the young devoted Messi fan's father.