Germany triumphed 6-5 over Italy in a wild, nine-round penalty shootout to advance to the semifinals at Euro 2016 after the game ended 1-1 after extra time.
After Leonardo Bonucci's 78th-minute penalty cancelled out Mesut Ozil's opener for Germany, the quarterfinal was decided from the spot, where both teams missed three times before Manuel Neuer stopped Matteo Darmian's effort in the ninth round.
Jonas Hector struck the winning effort to get Germany past the Italians for the first time in a major tournament, following four Italy triumphs in knockout stages and four group-stage draws.
Both teams started with three at the back, and though there was plenty of possession in each other's halves, true chances were hard to find in the opening minutes.
Germany were forced into an early change when Sami Khedira pulled up while chasing a loose ball in the 12th minute, signalled to the bench and was soon replaced by Bastian Schweinsteiger.
On 20 minutes, Gomez found himself in behind the defence and stretched to get his foot to a long Mats Hummels pass, but the forward could not control it and it fell to Gianluigi Buffon to grab.
Germany had a goal ruled out in the 27th minute, when Hummels found Schweinsteiger with another long, lofted pass, though the substitute could have no real complaint after fouling Mattia De Sciglio to get to the ball.
Italy fought off the German pressure and had a chance of their own when Joshua Kimmich misplayed a cross. It fell to De Sciglio, whose cross was picked out by Jerome Boateng before it could reach Emanuele Giaccherini.
Hector's 35th-minute cross took a deflection off of Alessandro Florenzi and fell at the near post, but Buffon gathered it after initially spilling it on an awkward bounce.
Gomez was again the target man as the striker cut across the box to meet Kimmich's 41st-minute cross, only to head well over the bar.
A minute later, Germany threatened again when Toni Kroos' shot from the top of the box took a few deflections before falling to Thomas Muller, who is still in search of his first goal of the tournament and would not find it here as Buffon caught his soft attempt.
Italy then had the best opportunity of the first half when Giaccherini stayed onside to receive a long pass, then cut back a pass from the byline. It skipped right past Florenzi, who was waiting to tap in, and Stefano Sturaro lashed a shot that fell wide of the far post after a touch from Boateng.
Germany had the first threat of the second half in the 54th minute, when Kroos passed to a streaking Gomez, who laid off to Muller. The striker took a shot that Florenzi acrobatically put behind for a corner, but the shot appeared to be headed wide anyway.
Italy then had three players -- Stuaro, De Sciglio and Marco Parolo -- booked in as many minutes as they tried to quash the German attack.
But the yellow cards only prolonged the inevitable as Germany found the breakthrough in the 65th minute.
Gomez prevented the ball from going out on the sideline and found Hector on an overlapping run. The left-back's pass to the centre of the box took a deflection off of Bonucci and fell directly into Ozil's path to score.
Buffon prevented Germany from doubling their advantage three minutes later as Hummels played in Gomez, but the goalkeeper was there to tip over the forward's audacious attempt with his back to goal.
Italy nearly equalised in the 74th minute when Graziano Pelle's shot from eight yards flashed past the post, but the goal soon came when Hungarian referee Viktor Kassai pointed to the penalty spot three minutes later.
Boateng was caught with both arms above his head as he tried to get in front of Giorgio Chiellini, and the defender's flicked header came off his elbow. Bonucci made no mistake with a well-taken penalty past the outstretched Neuer to level the score.
And Italy nearly went ahead on 81 minutes when Eder cut inside along the top of the box and fed Pelle, who could only manage an off-target shot.
The game headed to extra time, where Pelle and Giaccherini became the fourth and fifth Italy players to be booked, but it was a cagey first 15 minutes with few chances.
Substitute Julian Draxler came close to scoring with his back to goal early in the second period when Andrea Barzagli couldn't fully clear a cross.
Germany then pushed forward on a counter-attack, but Draxler's through ball into the box was out of Muller's reach.
Italy's lone chance of the extra 30 minutes was Lorenzo Insigne's angled shot in the 113th minute that Neuer saved, and though Germany pressed hard for a winner in the final minutes, the game headed to penalties still level at 1-1.
Insigne's opening goal was answered by Kroos, but then Simone Zaza -- who came on moments before the shootout -- sailed his attempt over the bar. But Buffon then saved Muller's penalty to keep the tally level.
Barzagli put Italy ahead, and then Ozil's shot hit the post. Pelle followed the miss by sending a horrible effort wide, and Draxler scored to put it back to 2-2.
Germany had a chance to win it after Neuer saved from Bonucci in the fifth round, but then it was Schweinsteiger's turn to blast over the bar.
Giaccherini and Hummels converted, then Parolo and Kimmich followed suit. De Sciglio put his attempt in off the underside of the bar, with Boateng making it 5-5 after eight rounds.
Neuer then saved substitute Darmian's low shot, and Hector got his effort under Buffon to end it.
Germany will face the winners of Sunday's quarterfinal between Iceland and hosts France, in a last-four tie on July 7 in Marseille.
The reigning World Cup champions will be without Hummels, who will be suspended after receiving a yellow card late in the second half.