Argentina beat France 4-2 on penalties following a dramatic 3-3 deadlock after extra time in the World Cup final on Sunday, helping captain Lionel Messi crown one of soccer's greatest careers.

The 35-year-old superstar said before the final this World Cup is his last, and the thrilling showdown against the defending champions at Qatar's Lusail Stadium provided a memorable exit from the sport's biggest stage.

Argentina players celebrate after winning the World Cup football final against France at Lusail Stadium in Lusail, Qatar, on Dec. 18, 2022. (Kyodo) ==Kyodo

Messi struck two goals and helped create another, while his Paris Saint-Germain teammate Kylian Mbappe scored a hat-trick, including a pair of penalties, as he carried France's title defense on his shoulders.

Argentina goalkeeper Emiliano Martinez was also a hero for his side, saving Kingsley Coman's penalty before Aurelien Tchouameni fired wide to give the South Americans their third World Cup title and first since 1986. Messi and the rest of Argentina's four penalty takers found a way past France keeper and skipper Hugo Lloris.

Aston Villa stopper Martinez made sure the final would go to spot kicks with an outstanding save to deny Randal Kolo Muani at the end of extra time.

Argentina's Lionel Messi (R) and France's Kylian Mbappe vie for the ball during the second half of the World Cup football final at Lusail Stadium in Lusail, Qatar, on Dec. 18, 2022. (Kyodo) ==Kyodo

Argentina appeared to be cruising to victory with a 2-0 lead from a Messi penalty and an Angel Di Maria strike on the counter before two late goals from the 23-year-old Mbappe ensured at least 30 additional minutes would be needed.

Messi opened the scoring from the spot in the 23rd minute after Ousmane Dembele was judged to have brought down Di Maria. The Argentine captain was also integral to a crisp counterattack that culminated in Di Maria stroking home Alexis Mac Allister's cross to double the lead 13 minutes later.

With Argentina's fans ready to celebrate, France grabbed a lifeline in the 79th minute when Nicolas Otamendi felled Kolo Muani. Mbappe buried his penalty to make it 2-1, then equalized almost immediately, volleying past Martinez on a lightning counter.

Argentina went back in front 3-2 through Messi in the 108th minute, but the champagne was put on hold again 10 minutes later, with Mbappe leveling from the spot after his shot found Gonzalo Montiel's elbow at the edge of the area.

Argentina's Lionel Messi scores from the penalty spot during the first half of the World Cup football final against France at Lusail Stadium in Lusail, Qatar, on Dec. 18, 2022. (Kyodo) ==Kyodo
Kylian Mbappe scores a goal from the penalty spot during the second half of the World Cup football final against Argentina at Lusail Stadium in Lusail, Qatar, on Dec. 18, 2022. (Kyodo) ==Kyodo

Montiel made amends by slotting his team's decisive penalty in the shootout, finally sparking celebrations.

Messi's performance throughout the tournament made him the first two-time winner of the Golden Ball award for best men's World Cup player. He was runner-up to Mbappe for the Golden Boot award for top scorer, tallying seven goals to the Frenchman's eight. Martinez earned the Golden Glove for best goalkeeper.

Argentina players celebrate after a penalty shootout win over France in the World Cup football final at Lusail Stadium in Lusail, Qatar, on Dec. 18, 2022. (Kyodo) ==Kyodo
 
France players look downcast after a penalty shootout loss to Argentina in the World Cup football final at Lusail Stadium in Lusail, Qatar, on Dec. 18, 2022. (Kyodo) ==Kyodo

Qatar's World Cup was initially overshadowed by concerns about the country's human rights record, including the deaths of migrant laborers working on stadium construction, but the international media spotlight turned mostly to the pitch once the tournament kicked off.

Saudi Arabia's 2-1 upset win against Argentina early in the group stage set the tone for a solid tournament by the Asian confederation, which saw a record three teams -- Australia, Japan and South Korea -- go through to the knockout stage.

Japan caused a sensation by topping what many considered the toughest group in Qatar following thrilling 2-1 wins against Germany and Spain, which came either side of an upset loss to Costa Rica.

The Samurai Blue's rollercoaster campaign ended in a round-of-16 penalty shootout defeat to Croatia, who eventually claimed third place in a playoff against another of the tournament's headline grabbers, Morocco.

The North Africans became the first team from their continent to reach the semifinals and won a legion of admirers along the way as they eliminated heavyweights Spain and Portugal.

Argentina's Lionel Messi (C) holds the trophy after winning the World Cup football final against France at Lusail Stadium in Lusail, Qatar, on Dec. 18, 2022. (Kyodo) ==Kyodo

Related coverage:

IN PHOTOS: Best Moments of World Cup Qatar 2022 (Part I)

IN PHOTOS: Fans at World Cup 2022

Japan's World Cup performance to bring $120 mil. in economic effects