A late strike from Marcos Rojo gave Argentina a nail-biting 2-1 victory over Nigeria in Group D on Tuesday and sent the twice champions through to the knockout stages of the World Cup.

Lionel Messi scored his first goal of the tournament in the 14th minute with an inch-perfect taken shot. But Nigeria resumed parity six minutes after the restart, when Javier Mascherano fouled Leon Balogun in the area and Victor Moses stepped up to slot to make it 1-1.

With the game slipping away from the two-time World champions, Gabriel Mercado crossed from the right in the 86th minute and it was who Rojo turned the ball into the goal with a first time strike to spark wild celebrations from the Argentines.

Leo Messi missed a penalty in a 1-1 draw with Iceland and was largely bypassed in a 3-0 thrashing by Croatia that saw calls for Argentina coach Jorge Sampaoli to be sacked before their final group game in Saint Petersburg.

Sampaoli made five changes from the Croatia game, with veterans of the Albiceleste’s run to the final four years ago Gonzalo Higuain and Angel di Maria returning, but it was the recall of Ever Banega in midfield that provided the launchpad for Messi.

The Sevilla midfielder’s brilliant pass over the top of the Nigerian defence in the 14th minute picked out Messi’s run perfectly.

After cushioning the ball on his thigh, the five-time world player of the year erased the frustrations of his World Cup so far with an arrowed right-foot finish into the far corner.

“I knew that God was with us and would not leave us out of the competition,” Messi said. “I don’t remember having ever suffered so much, because of the situation and because of what was at stake. It was a huge release for all of us. “

We had been through difficult days because of the result in the previous game, the situation we were in and because of a lot of things that came out. But fortunately we were able to achieve our objective. We knew we would do so. We didn’t expect to suffer so much but we were confident that we would get through. And thank God it happened.”

Sampaoli had been under severe pressure before the match but his side showed vast improvement from their previous two matches in Russia, despite needing Rojo’s late goal to make it through.

“We played a very good first half,” Sampaoli said. “We kept the ball, controlled the game and got a lot of touches. Things became more difficult when they got the penalty and then there were nerves and anxiety which came out in the happiness at the end. These players played with heart, they rebelled, and they got a win which allows us to continue and which will be important in strengthening them for the future.

“This is a triumph of self-belief, of the conviction of players who had the strength to believe and to keep looking for the goal right to the end. The most significant element was the bravery with which they played; there was a lot of courage.”

Messi also saw a free-kick come back off the post, but Argentina’s lead remains a precarious one. Argentina face France in the last 16 after finishing second in the group, while Croatia take on Group C runners-up Denmark. Nigeria and Iceland are out after finishing third and fourth.