Christian Gimenez scored twice as Pachuca came from two goals down to defeat Al Ahly in extra-time in the quarter-finals of the FIFA Club World Cup.
Pachuca bossed possession in the first half at the Tokyo National Stadium, but an own goal by Fausto Pinto and Flavio's strike on the counter-attack gave African champions Al Ahly a 2-0 lead at half-time.
But substitute Luis Montes pulled a goal back for the CONCACAF champions two minutes into the second half and Gimenez fired home a superb free-kick to force extra-time.
Damian Alvarez then put the Mexicans ahead eight minutes into the extra period before Gimenez settled the match with 10 minutes remaining, setting up a semi-final clash against Copa Libertadores champions Liga Deportiva Universitaria of Ecuador on Wednesday.
Pachuca were looking to make amends for a 1-0 loss to Tunisia's Etoile du Sahel at the same venue 12 months ago and dominated play in the opening half.
The best they had to show for their possession though was a Gimenez free-kick in the 17th minute and a Bruno Marioni attempt from the top of the box six minutes later, both of which were easily handled by goalkeeper Amir Abdelhamed.
Al Ahly proved more effective on the counter-attack and took the lead against the run of play in the 28th minute.
Mohamed Aboutrika made a quick burst down the left flank and attempted to find Flavio with a low cross only for the ball to deflect off Pinto past a wrong-footed Miguel Calero.
Another quick raid resulted in a second goal in the final minute of the half. Aboutrika gathered in a long ball on the right flank and cut it back inside for Mohamed Barakat who slid it on for an unmarked Flavio to fire into the roof of the Pachuca net.
Al Ahly had the ball in the net again within 60 seconds of the restart but Barakat's effort was disallowed for offside.
The Mexican side took full advantage of the let-off, pulling a goal back just a minute later when a free-kick from the right by Montes eluded a crowd of players in the middle and snuck in at the far post.
The equaliser arrived with 17 minutes remaining after Al Ahly skipper Shady Mohamed brought down Gimenez on the edge of the box. The Argentinian took the free-kick himself, curling the ball into the left corner of the net.
With just 90 seconds remaining, Pachuca nearly grabbed a winner as Gimenez thumped in a shot from 20 yards that was superbly stopped by Amir. Marioni hit the upright with the follow-up although he had strayed into an offside position.
Eight minutes into extra-time, an attempted clearance ricocheted off Alvarez and bounced into the Al Ahly box, where the Argentinian gathered the ball again before lashing it past Amir.
With 10 minutes left, Gimenez made the game safe for the Mexican side, exchanging passes with Marioni on the edge of the box before firing an unstoppable effort into the Al Ahly net.