This combination of photos shows Germany’s Miroslav Klose flipping to celebrate after scoring his side’s second goal during the group G World Cup soccer match between Germany and Ghana at the Arena Castelao in Fortaleza, Brazil, Saturday, June 21, 2014. (AP Photo/Frank Augstein)

This combination of photos shows Germany’s Miroslav Klose flipping to celebrate after scoring his side’s second goal during the group G World Cup soccer match between Germany and Ghana at the Arena Castelao in Fortaleza, Brazil, Saturday, June 21, 2014. (AP Photo/Frank Augstein)

Germany’s Miroslav Klose takes a shot during the group G World Cup soccer match between Germany and Ghana at the Arena Castelao in Fortaleza, Brazil, Saturday, June 21, 2014. (AP Photo/Frank Augstein)

Germany’s Miroslav Klose, center, scores his side’s second goal during the group G World Cup soccer match between Germany and Ghana at the Arena Castelao in Fortaleza, Brazil, Saturday, June 21, 2014. (AP Photo/Frank Augstein)

Argentina’s Lionel Messi, left, scores during the group F World Cup soccer match between Argentina and Iran at the Mineirao Stadium in Belo Horizonte, Brazil, Saturday, June 21, 2014. Argentina won 1-0. (AP Photo/Jon Super)

Argentina’s Lionel Messi celebrates after scoring his side’s lone goal in Argentina’s 1-0 victory over Iran during the group F World Cup soccer match between Argentina and Iran at the Mineirao Stadium in Belo Horizonte, Brazil, Saturday, June 21, 2014. (AP Photo/Fernando Vergara)

Buy AP Photo Reprints

RIO DE JANEIRO (AP) â” Miroslav Klose scored a World Cup goal for the record books. Lionel Messi grabbed a late winner to put Argentina into the round of 16.

Nigeria eliminated Bosnia-Herzegovina from its first World Cup with a 1-0 win, with Peter Odemwingie’s first-half goal getting the African champions closer to the knockout stage.

Klose’s 15th World Cup goal matched Brazilian great Ronaldo’s record tally on football’s greatest stage, more importantly for his team, it secured a 2-2 draw for Germany against a spirited Ghana team.

The 36-year-old Klose, came off the bench in the second half for his first action in his fourth World Cup, had been level with former Germany striker Gerd Mueller on 14 goals.

Klose celebrated his landmark goal with a trademark somersault.

“It was complete, but I can’t remember the last time I did it,” Klose said of the backflip. “Still, 15 goals in 20 matches, that’s not bad. But the important thing is to play well against the United States.”

Germany’s draw means the United States would advance from Group G if it beats Portugal on Sunday.

Kept out for 90 minutes by Iran’s stubborn defense, Messi finally struck in injury time Saturday with a curling, left-foot shot that gave Argentina its second far-from-convincing win in Brazil, beating Iran 1-0 after edging Bosnia 2-1 in Group F.

Argentina coach Alejandro Sabella conceded that Iran gave his team a tough time in the second half, “But having Messi resolved everything.”

So far, the Barcelona wizard is the only Argentine player to score in Brazil and he is as vital to his team as previous No. 10 Diego Maradona was when he scored five and created five more of Argentina’s 14 goals as the country lifted the World Cup in 1986.

Maradona was watching in Belo Horizonte as Argentina struggled to break down Iran and goalkeeper Sergio Romero kept his team in the match with a finger-tip save on Fulham forward Ashkan Dejagah’s second-half header.

Germany’s thrilling clash with Ghana was far more open.

Klose scored his equalizer in the 71st minute, about two minutes after coming on as a sub, sliding to knock a corner into the roof of the net.

Mario Goetze gave Germany the lead in the 51st, but Andrew Ayew equalized three minutes later and captain Asamoah Gyan then put the Africans ahead in the 63rd, only to see Klose draw the teams level again.

Odemwingie sealed Nigeria’s first victory at a World Cup since 1998 â” spanning 10 matches â” by finishing from close range in the 29th minute after one of a string of powerful runs by fellow striker Emmanuel Emenike.

Bosnia faded after a bright start, during which star striker Edin Dzeko had a goal contentiously disallowed for offside, and is still without a point in Group F following a 2-1 defeat to Argentina in its opener.

A draw would have given the Bosnians something to play for in its last group match, against Iran, but Dzeko had a shot tipped onto the post by goalkeeper Vincent Enyeama in the final few seconds, ending their hopes.

Messi appeared to have won a battle with his coach over which formation to use as Argentina started with three forwards in a 4-3-3 system. He was critical of Sabella’s decision to start the match against Bosnia with a more defensive 5-3-2 formation. Sead Kolasinac scored an own goal and Messi got the second for his team in that match.

Inevitably, it was Messi who stepped up in the dying seconds to steal the points against Iran.

Before the match, dozens of Jewish demonstrators held a minute’s silence, demanding justice for a still unsolved bombing attack against a Buenos Aires Jewish center 20 years ago that left 85 dead and for which Iran has been blamed.

In Rio, England players struggled to digest their early World Cup exit as they trained for their last match in Brazil and Wayne Rooney backed embattled coach Roy Hodgson.