RIO DE JANEIRO — Mario Goetze produced the piece of individual skill that Lionel Messi couldn’t muster.
With two quick, deft touches, Goetze ended Germany’s 24-year wait for another World Cup title — and denied Messi the one title he needs to forever take his place among the game’s all-time greats.
Goetze scored the winning goal in extra time to give Germany a 1-0 victory over Argentina on Sunday in a tight and tense World Cup final that was decided by one moment of brilliance.
Goetze, who wasn’t born when West Germany beat Argentina in the 1990 final, controlled a cross with his chest in the 113th minute and in one fluid motion volleyed the ball past goalkeeper Sergio Romero and inside the far post from 5 yards out.
It was a goal that gave Germany its fourth World Cup title, tied for second with Italy on the list of all-time champions and just behind Brazil’s five.
‘‘It’s an unbelievable feeling. I don’t know how to describe it. You just shoot that goal in, you don’t really know what’s happening,’’ Goetze said. ‘‘And then at the end of the match, having a party with the team, the whole country . . . it is for us, a dream come true.’’
At the final whistle, Germany players fell into a pile in the middle of the field in celebration. Messi walked past them with his hands on his hips — still in the shadow of his compatriot Diego Maradona, who led his country to the 1986 title.
Goetze went on as a substitute for Miroslav Klose toward the end of regulation time and his fresh legs made the difference.
Andre Schuerrle broke down the left flank, sending his cross into the area, and the Bayern Munich midfielder did the rest with a clinical finish. The goal echoed that of Andres Iniesta four years ago, when the midfielder scored in similar fashion but from the other side of the area to give Spain a 1-0 extra-time win over the Netherlands.
According to Germany coach Joachim Loew, it was exactly as he’d planned when he made the substitution.
‘‘I said to Mario Goetze, ‘OK, show to the world that you’re better than Messi and you can decide the World Cup. You have all the possibilities to do that,’ ’’ Loew said. ‘‘I had a good feeling with him.’’
Germany became the first European team to win a World Cup in the Americas, and the victory ends a string of near misses since winning its last major title at the 1996 European Championship. The team lost the 2002 World Cup final to Brazil, the Euro 2008 final to Spain, and was eliminated in the Cup semifinals in both 2006 and 2010.
Argentina had not been back in the final since that 1990 loss, and has now been beaten by Germany in the last three World Cups.
‘‘This was our chance, and we felt that way. We couldn’t do it. We have to lift our heads and suffer the pain,’’ Argentina midfielder Javier Mascherano said. ‘‘Obviously, the pain is tremendous.’’
It is Germany’s first World Cup title as a unified nation, having won as West Germany in 1954, 1974, and 1990.
The Germans faced Argentina in both the 1986 and 1990 finals, during Maradona’s heyday. This time, they were up against Messi, the four-time world player of the year who has set a slew of scoring records in leading Barcelona to every major club title and is widely considered the best player since Maradona.
But in the biggest game of his career, Messi came up short.
He had one good chance to score when he was sent free just after the halftime break, but sent his shot wide. It was a difficult angle, but still the type of chance he so often converts for Barcelona.
Messi threatened intermittently throughout the match, but was effectively smothered by the German defense. His free kick in the 120th minute went well high.
Messi, who scored four goals in the group stage but none in the knockout rounds, then had to trudge alone up the stairs of the Maracana Stadium to accept the Golden Ball award for the tournament’s best player, shaking hands with German Chancellor Angela Merkel along the way.
Shortly afterward, the German team made its way up the stairs for captain Philipp Lahm to raise the hallowed 18-carat gold trophy as confetti rained down and fireworks exploded in the sky.
‘‘It’s incredible how hard we worked and what a performance we produced,’’ Lahm said. ‘‘It’s an incredible feeling.’’
Until Goetze’s winning goal, the game was more notable for top-class defending than creative attacking, but both teams had their share of chances — particularly in the first half.
Gonzalo Higuain fired wide when gifted a chance in a one-on-one with goalkeeper Manuel Neuer, and later had a goal ruled out for offside.
Germany defender Benedikt Hoewedes hit the post just before halftime with a header.
Germany had entered the game as the favorite after its 7-1 semifinal drubbing of Brazil. But Argentina proved to be an entirely different proposition.
‘‘I'm very proud of the team. They played a great game against a great team,’’ Argentina coach Alejandro Sabella said. ‘‘I salute the players, they made the country proud for the championship they played.’’
After Germany’s last win in 1990, then-coach Franz Beckenbauer predicted that a unified Germany would be ‘‘unbeatable’’ in the future. It took 24 years to prove him right but with young players like Goetze, the next wait may not be as long.
‘‘We, I think, deserve this trophy,’’ Goetze said.