Uriel Antuna's 93rd-minute winner secured a dramatic 2-1 victory for Mexico against Bermuda in their final CONCACAF Nations League group game.
Tuesday's clash had been petering out for a draw after Sebastian Cordova's stunning solo goal cancelled out Dante Leverock's shock opener in Toluca.
However, Antuna spared Mexico's blushes deep into stoppage time as El Tri made it four wins from four matches in Group B in League A.
Already assured of a semi-final spot, Mexico handed a debut to Luis Romo, while there were seven players in the starting XI with under 10 caps.
There was an early chance for Mexico, but the home side were made to pay for a lacklustre start against Bermuda.
After Hugo Gonzalez almost handed Bermuda the lead following a poor pass – Hector Moreno's desperate defending rescuing Mexico – the visitors broke the deadlock from the resulting corner.
Bermuda captain Leverock gave the minnows a shock lead in the 10th minute when he sprinted into the six-yard box and rose highest to bundle the ball over.
Cordova almost equalised three minutes later, however, his free-kick was pushed away by the diving Dale Eve, who was less than convincing in dealing with Jose Macias' long-range effort in the 24th minute.
Mexico eventually equalised approaching the half-hour mark, a moment of individual brilliance from Cordova restoring parity after the 22-year-old received the ball on the edge of the area, dummied and switched feet before firing a shot across goal and past Eve for his first international goal.
Some neat play almost saw Macias put Mexico ahead in the 38th minute but his side-footed effort looped just over the crossbar.
Bermuda threatened to restore their lead, but some more last-ditch defending prevented Mexico from falling behind again just past the hour-mark.
A diving Eve, meanwhile, was relieved to see Antuna's header fly past the post minutes later.
Gerardo Martino turned to Raul Jimenez for a goal and the Wolves star nearly delivered – his chested attempt from close-range saved by Eve with 14 minutes remaining – but Antuna stepped up at the death to secure all three points.
What does it mean? Improvement needed
Martino made changes for this fixture, handing chances to a host of players with their semi-final passage already sealed. While Mexico preserved their 100 per cent record, it was a sluggish display.
Cordova a shining light for Mexico
On a night Mexico failed to impress, Cordova further highlighted his growing quality. A maiden international goal capped a memorable outing for the America midfielder, who has been linked to Manchester United, Sevilla and Benfica.
Bermuda prove frustrating
Not much was expected of Bermuda, who were routed by Mexico 5-1 in the reverse fixture. But Bermuda deserve credit for their display away from home. Ranked 168th in the world, Bermuda were disciplined and threatening on the break.
Mexico's international commitments have concluded for the year, with El Tri looking ahead to the 2020 Nations League semis. Bermuda will be hoping to bounce back next year.