Often referred to as an Argentinian-Spanish player, this crossover was brought into sharp focus when in 2004, Lionel was offered the chance to play for the Spanish national U-20 team. He declined the offer given his Argentinian heritage, and was given the opportunity to play for Argentina's U-20 team in a friendly match against Paraguay in June 2004. Messi scored once against Paraguay and twice in friendly against Uruguay in July 2004. In 2005 he was part of a team that finished 3rd in 2005 South American Youth Championship in Colombia. He won the 2005 FIFA World Youth Championship in the Netherlands with the team and won the Golden Ball and the Golden Shoe, scoring in the last four of Argentina's matches and netting a total of six for the tournament.
He made his full international debut on 17 August 2005 against Hungary at the age of 18. He was substituted on during the 63rd minute, but was sent off on the 65th minute because the referee, Markus Merk, claimed that Messi had allegedly elbowed defender Vilmos Vanczák, who was tugging Messi's shirt. The decision was contentious and Maradona even claimed the decision was pre-meditated. Messi was later reportedly found weeping in the changing rooms after the decision. Messi returned to the team on 3 September in Argentina's 1–0 World Cup qualifier away defeat to Paraguay. Ahead of the match he had said "This is a re-debut. The first one was a bit short." He then started his first game for Argentina against Peru, in which he was able to win a crucial penalty for Argentina; after the match Pekerman described Messi as "a jewel". He scored his first goal for Argentina in a friendly match against Croatia on 1 March 2006.
On 28 March 2009, in a World Cup Qualifier against Venezuela, Messi wore the number 10 jersey for the first time with Argentina. This match was the first official match for Diego Maradona as the Argentina manager. Argentina won the match 4–0 with Messi opening the scoring.
On 17 November 2010, Messi scored a last-minute goal against South American rivals Brazil after an individual effort to help his team to a 1–0 win in the friendly match, which was held in Doha. This was the first time that he had scored against Brazil at senior level. Messi scored another last-minute goal on 9 February 2011 against Portugal in a penalty kick which gave his side a 2–1 victory in the friendly match, which was held in Geneva, Switzerland. He had also previously assisted the first goal. His first hat-trick for Albiceleste came against Switzerland, on 29 February 2012 which the game ended 3–1 for Argentina. On 9 June 2012, Messi scored his second international hat-trick in a friendly match against rivals Brazil, including the match winner. The match ended 4–3 to Argentina and Messi was voted man of the match. This brought his international goalscoring tally up to 26 goals in 70 matches, and brought his 2012 tally up to 7 goals in 3 matches. This was also his record-breaking 82nd goal of the season, including all club and international matches.