Lionel Messi said that he had never suffered as much as he did in St Petersburg but insisted that he never feared Argentina being knocked out of the World Cup because God would not allow it.

Messi scored a superb opening goal to give Argentina a 1-0 lead and put them in a position to progress to the last 16 but a second-half penalty from Victor Moses left them on the verge of elimination until the Manchester United defender Marcos Rojo volleyed in a dramatic 87th-minute winner.

At the final whistle, Argentina’s players collapsed, some in tears. After a week of tension and accusation, their manager, Jorge Sampaoli, talking about a “disaster”, Argentina finally found a way through and will now face France in Kazan.

“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.”

At the end of the match Messi embraced Sampaoli, after a week in which there had even been reports of the players demanding his resignation.

“That gesture makes me very proud,” Sampaoli said. “He knows the passion I put into everything I do, the journeys I made to talk to him; he knows that we had shared our dream of coming to Russia to do something important for Argentina.”

“We have the best player in the world and we have to make the most of that,” Sampaoli added. “My main concern is that Messi has continuity on the pitch: if he has a lot of the ball, then we have chances. If he gets isolated, then Argentina suffer.”

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.”

Asked if he had ever suffered as much as he had here, Sampaoli responded with a single word: “No.”

The Nigeria captain, Mikel John Obi, complained that his side should have been given a penalty when the ball hit Rojo on the arm with the score at 1-1 late in the second half. The referee, Cuneyt Cakir, consulted VAR but decided not to award a second spot kick.

“I don’t understand how that was not a penalty: it was a clear handball,” Mikel said. “It was worse than the one that Portugal were given yesterday.

“The ball hit his hand and his hand was open [away from his body]. Maybe the referee gave the first and so he didn’t want to give the second one. But if it is a penalty, it is a penalty.

“We have seen it again in the dressing room and its a clear handball. It’s a clear penalty. I said to the ref: ‘Did it hit his hand?’ He said: ‘Yes’. I said why is it not a penalty then and he said he didn’t know.”

Guardian services