Russia fought valiantly in Kazan but the hosts could not avoid early elimination from the Confederations Cup, losing 2-1 to Mexico, who join the Group A winners, Portugal, in the semi-finals after the European champions beat New Zealand 4-0 in St Petersburg.

Needing a win to advance from their difficult group, Russia played well and took the lead with a goal by Alexander Samedov in the first half, but the experienced Mexico side equalised with Néstor Araujo before half-time and secured the victory early in the second half with a goal by Hirving Lozano after a blunder by the goalkeeper Igor Akinfeev.

Russia had plenty of chances, but poor finishing resigned them to defeat. Several players missed clear opportunities throughout the match played in front of 41,585 at Kazan Arena. Russian players gathered in the centre of the pitch to salute fans after the final whistle and were applauded by the crowd.

Mexico had a second-half goal by the defender Héctor Moreno disallowed for offside after video review.

Russia were the lowest-ranked team in the eight-nation competition among continental champions plus the World Cup winners and the host nation.

Advancing from the group with Portugal, and the Gold Cup winners, Mexico, was seen as a difficult task from the start, but an opening victory against New Zealand had left Russia in position to make it to the semi-finals despite a defeat to Portugal in the second match.

The opening goal came following pressure by the Russian attack in the 25th minute. After the striker Fedor Smolov struck the post with a long-range shot and Yury Zhirkov had his shot saved by Guillermo Ochoa, Russia kept possession and sent the ball back into the area, where Aleksandr Erokhin missed a chance before Samedov picked up his pass and sent a low shot into the far corner.

Mexico equalised five minutes later after Héctor Herrera’s long cross into the area found Araujo near the far post. The defender headed the ball into the opposite corner, over Akinfeev.

Akinfeev made a mistake that led to Mexico’s second goal after a long clearance by Herrera from near the south American side’s area. The ball took a high bounce and started to fall just at the edge of Akinfeev’s box. The goalkeeper apparently was not sure if he could use his hands and ended up taking too long to commit to the ball with his feet, allowing Lozano to nip in and head it into the open net. To make matters worse for the hosts, Zhirkov was sent off for a second bookable offence with a quarter of the match to go.

In St Petersburg, Portugal coasted to a 4-0 win over New Zealand but it came at a cost as the Manchester City-bound Bernardo Silva was substituted because of an ankle injury.

Cristiano Ronaldo scored Portugal’s opening goal from the penalty spot on 33 minutes after the Ipswich defender Tommy Smith bundled over Danilo Pereira following a corner.

Four minutes later Bernardo Silva – set to leave Monaco in a £43m deal – doubled the lead with a close-range finish from a low cross from Pereira Eliseu, but in doing so landed awkwardly on his ankle before Tom Doyle made a sliding challenge on the midfielder. He was taken off at half-time.

Just before half-time, the Portugal forward André Silva lashed out at Michael Boxall after a tussle with the defender, that left him with a torn shirt – but could easily have also resulted in a red card.

André Silva wrapped up the comfortable victory with a fierce angled finish on 80 minutes and Nani added a fourth in stoppage time.