Argentina 2, Nigeria 1

Lionel Messi and Argentina finally came alive at the World Cup.

Messi scored an exquisite 14th-minute goal to give the two-time champions the lead in a must-win game against Nigeria Tuesday in St. Petersburg, but it wasn’t until Marcos Rojo’s 86th-minute strike that Argentina was assured of a place in the round of 16 with a victory.

Victor Moses scored from the penalty spot in the 51st minute for Nigeria, putting Argentina in danger of being eliminated without winning a match in Russia.

It took an unlikely goal by Rojo — a center back — to save Argentina with a cushioned volley into the corner.

The win gave the Argentines second place in Group D and allowed the soccer-mad nation to forget about the 3-0 loss to Croatia last week that sparked days of soul-searching within the squad and back home.

Argentina will play France in the last 16 in Kazan on Saturday, keeping alive Messi’s quest for a first world title. He might have retired from international soccer for a second time — and for good this time — if it wasn’t for Rojo’s goal.

Croatia 2, Iceland 1

Fielding a side filled with reserves, Croatia ended Iceland’s first World Cup run with a win in Rostov-on-Don.

Milan Badelj crashed a volley against the bar, and moments later scored for Croatia in the 53th minute, sprinting into the area to fire a bouncing shot past goalkeeper Hannes Halldorsson.

Croatia playmaker Luka Modric led the already-qualified Croats for 65 minutes before being taken off, as his team remained in low-gear for most of the match to contain the Icelanders who had needed a win to hope for a place in the last 16.

Iceland equalized with a penalty shot taken by Gylfi Sigurdsson in the 76th minute after substitute Dejan Lovren carelessly handled the ball. But Ivan Perisic punished a defensive error to make it 2-1 at 90 minutes.

Peru 2, Australia 0

Tim Cahill finally got onto the field in his fourth World Cup for Australia, asked to provide a spark with the Socceroos in desperate need of goals.

The goals didn’t follow and Cahill had no interest in talking about whether Australia’s 2-0 loss to Peru to close out the World Cup would be his final international appearance for his country.

Cahill made a swift exit following the loss in Sochi, giving a few polite waves but otherwise opting not to talk about his limited contributions to Australia at the World Cup in Russia. According to teammates, Cahill made no indication about his future with the national team.

At the end of the game, Cahill walked over and touched one of the goalposts before giving away his jersey to fans in the front row behind the Australia bench.

“I don’t know if it was the last time. Timmy never gives up,” Australia midfielder Aaron Mooy said. “His career is amazing. So driven mentally and had so much ability and someone I’ve always looked up to.”

Cahill came on as a second-half substitute after speculation about whether he would see the field after the forward, 38, was named in Australia’s final roster. He joined a select list of players to appear in four different World Cups and was trying to become the fifth player to score in four different tournaments.

Denmark 0, France 0

A game no team needed to win became the game no fan would want to watch.

France and Denmark produced the World Cup’s first 0-0 draw at the 37th attempt amid boos and whistles from fans in Moscow.

The slow-paced game was out of step with a vibrant tournament. But it advanced both teams to the round of 16 unbeaten, with the bonus of no players suspended and no serious injuries.

The draw would always have ensured that outcome, and became inevitable in the second half. Events elsewhere in Group C made this game all but irrelevant.

Peru beat Australia 2-0 in Sochi at the same time, meaning the Danes would have advanced even if they lost to France before 78,011 at the World Cup’s signature Luzhniki Stadium.

“We did what we needed,” Denmark coach Age Hareide said, praising his team for a disciplined display. “We would have been stupid to open a lot of space for the French team.”