(Reuters)

Argentina scored yet another vital World Cup goal with the help of a hand, but this one was completely legal.

In the 111th minute, Cristian Romero headed Lionel Messi's corner kick off the hand of Cape Verde defender Diney Borges, redirecting it inside the far post to complete ​a 3-2 victory in extra time of the round of 32 for the defending champions in an all-time great World Cup match on Friday in Miami Gardens, Florida.

Messi added his 20th career World Cup goal and tournament-leading seventh early in the contest, ⁠and Lisandro Martinez scored early in extra time to give the Argentines a 2-1 advantage.

Cape Verde, the ​smallest nation ever to reach the World Cup knockout round, answered those first two goals.

Deroy ​Duarte's 59th-minute leveler ‌was well- deserved after his side's bright start to the ⁠second half. ​Sidny Lopes Cabral's world-class strike stunned the crowd and evened it at 2-all in the 103rd minute.

But 40 years and 11 days after Diego Maradona's famous "Hand of God" goal -- which would have certainly been ruled out in the modern era of VAR -- the manual intervention this time was above board because it came ‌from a defender.

The advantage law allows a referee to ignore a foul - including a ‌handball - by a defending team if it benefits the attacking team. Had Borges' handball prevented Romero's header from going across the goal line, it likely would've resulted in an Argentina penalty kick.

Argentina's Emiliano Martinez made two crucial ​late interventions, including a denial of another attempt from Cabral, to set up a round of 16 meeting with Egypt in Atlanta on Tuesday.

The match was easily Argentina's most difficult of the tournament, and will leave Cape Verde as one of the competition's feel-good stories.

While they became the seventh African side to be eliminated from the competition, they earned worldwide respect with a performance that also included ‌draws against two other World Cup-winning nations, Spain ​and Uruguay.

"It was a very difficult match, more difficult than we expected," Messi said postgame. "It was difficult to score the first goal, but they showed why, because they had drawn against Spain and Uruguay.

"They are very disciplined. They have their weapons. They are very intense. And they ​hit at us. We were trading blows. But that ‌was ⁠expected. We expected to ‌suffer. We suffered. But it was an important win."

After leading ‌1-0 late in the first half through Messi's 29th-minute contribution, Argentina regained their lead two minutes into extra time.

Messi struck a corner kick to the near ⁠post, where Alexis Mac Allister met it with a flick-on header.

From there, the ball bounded across the ​goalmouth before Lisandro Martinez reached it on the far side of the penalty area, took a touch forward and then powered a left-footed strike seemingly through Vozinha into the roof of his net.

Improbably, Cape Verde leveled again through Lopes Cabral's world-class strike.
With Mac Allister defending, Lopes Cabral took a pass at the left edge of the box, cut past Mac Allister and then bent a looping strike well ​beyond the reach of the goalkeeper into the top right corner.

Vozinha, 40, was credited with ​eight saves after making seven in the tournament-opening scoreless draw with Spain.