Mario Balotelli stole the show in Rio, as he crashed in a second-half winner to ensure Italy marked Andrea Pirlo's 100th cap with victory at the Maracana.
The AC Milan striker fought his way into the penalty area and produced a fierce low shot to give the Azzurri their first win over Mexico since 1993 and, with it, the perfect start to their Confederations Cup campaign.
Pirlo himself had given Italy the lead midway through the first half with a trademark free-kick, only for Manchester United striker Javier Hernandez to bring Mexico level from the penalty spot.
Victory leaves Italy level on points with hosts Brazil at the top of Group A, with Japan next up on Wednesday. Mexico play Brazil on the same day.
Pirlo's free-kick was a magical moment and Italy remain unbeaten in the 12 matches in which the Juventus midfielder has scored. But as far as the Brazilian public was concerned the night belonged to Balotelli.
The former Manchester City striker had cut a frustrated figure for long periods of the match, having missed a series of early chances and been dumped on his backside by a series of heavy second-half challenges. There were even glimpses of that famous temper but, ultimately, he was not to be denied.
A balmy night at the Maracana witnessed a game packed full of attacking football - and the locals loved it. On both sides, the passing was fluid and the sense of adventure obvious.
From the outset Italy's attacking play looked elegant and effortless with three chances falling to Balotelli in the opening eight minutes.
Gerardo Torrado and Francisco Rodriguez continually looked stretched at the heart of the Mexican defence, as Balotelli chipped one chance over and fired two more into the arms of goalkeeper Jose Corona. But there was defensive uncertainty from the Italians too.
Former Tottenham and Barcelona midfielder Giovani Dos Santos was a constant threat, tricking his way into dangerous positions and creating one chance that saw Andres Guardado fizz a fierce shot beyond Gianluigi Buffon and against the frame of the goal after an error from Ignazio Abate.
It fell to Italy's veteran Pirlo to break the deadlock, with a free-kick that brought the Maracana to its feet.
The 34-year-old wrapped his foot around the ball with absolute precision, lifting it over the Mexico wall, beyond the flapping right hand of Corona, and high into the net.
Chants of "Pirlo, Pirlo" filled the air, but there was not long to enjoy the moment before Mexico struck back.
The Italy defence had been guilty of losing possession on a number of occasions and this time it was Juventus defender Andrea Barzagli who hesitated, allowing Dos Santos to dash beyond him before clumsily bringing him to ground. Hernandez made no mistake from the penalty spot and Italy left the field at half-time frustrated.
Balotelli was dumped on the floor by two thunderous Mexico challenges early in the second half, the second of them drawing an angry reaction from the 22-year-old. Another such challenge saw Italy awarded a free-kick, but this time Pirlo curled the ball a yard wide of the right-hand upright.
Growing increasingly frustrated, Balotelli then went down in the area under a challenge by Rodriguez and when referee Enrique Osses waved away his protests the crowd reacted as furiously as the player.
Mexico continued to attack, Gerardo Flores heading wide from a corner, but with both sides struggling to match the dynamism of the first half, Daniele De Rossi finally lofted a pass high towards Balotelli in the penalty area.
The striker bulldozed his way beyond Rodriguez and Torrado before firing a powerful low shot beyond Corona to the delight of the Brazilian public.
Italy striker Mario Balotelli: "It was a great game, a great feeling and a wonderful crowd.
"I don't care about the referee, the important thing is that we won. That's all. If we win the next game, then we can progress.
"It would be wonderful to play here in the final and we will do everything to get there, it doesn't matter who it is against.
"Do we have what it takes to reach the final? I think we really do."