PHOENIX (AP) — The final comeback belonged to the Arizona Diamondbacks, and it was the greatest of all.

Luis Gonzalez hit an RBI single to cap a two-run rally off Mariano Rivera in the bottom of the ninth inning, and Arizona stunned the New York Yankees 3-2 in Game 7 of the World Series on Sunday night.

The Yankees were only two outs from their fourth straight World Series title when it all fell apart.

Tony Womack tied it with an RBI double and, after Craig Counsell was hit by a pitch to load the bases, Gonzalez blooped a soft single to center field.

Rivera, who had saved 23 straight postseason games, could do nothing but watch the ball fall in to end the Yankees’ dynasty.

What began as a November duel between Curt Schilling and Roger Clemens climaxed with the Diamondbacks winning the title in just their fourth year of existence. It was the fastest rise in history, breaking the mark of five years set by the 1997 Florida Marlins.

The Diamondbacks did it by bouncing back from two of the toughest losses in Series history. They dropped Games 4 and 5 at Yankee Stadium, blowing two-run leads in the bottom of the ninth both times.

Randy Johnson, at 38, earned the victory in relief. He also won Game 6 on Saturday night, a 15-2 romp.

Johnson and many other Arizona old-timers such as Mark Grace, Matt Williams and Mike Morgan won their first championship ring.

The Yankees, the team that would not give up, nearly won it for the city that would not give in. A highly motivated bunch, they showed extra resolve after the Sept. 11 terrorist attacks in New York.

The Yankees were a home run swing away from elimination in the first round against Oakland, and lost the first two games at Bank One Ballpark.

But back in the desert, they looked lost.

Alfonso Soriano’s solo homer off Schilling put New York ahead 2-1 in the eighth. Rivera, the most dominant reliever in postseason history, set down the Diamondbacks in the bottom half.

Then in the ninth, Arizona rallied.

Grace led off with a single and Rivera threw away Damian Miller’s bunt for an error, putting runners at first and second.

Jay Bell bunted into a force play at third, but Womack lined a tying double to the right-field corner. Counsell, who scored the winning run in Game 7 with Florida in 1997, was hit by a pitch.

With the infield in, Gonzalez hit it hard enough for a game-winning single that set off fireworks, pounding music and deafening cheers.

The Yankees fell to 5-6 overall in deciding Game 7s of the Series.

Schilling was nearly untouchable at the start. The first pitcher to start three games in a Series since Minnesota’s Jack Morris in 1991, he once again showed no ill effects from working on three days’ rest.

Schilling allowed only one hitter to reach through six innings, and even that guy did not last long on the bases. Paul O’Neill, playing his final game before retiring, was thrown out trying to stretch a double into a triple in the first.

But given a 1-0 lead in the sixth on Danny Bautista’s RBI double, Schilling gave it back.

A strange wind started swirling through the ballpark to start the top of the seventh. Maybe it was a precursor of what was to come because moments later, Arizona had blown its edge.

Schilling retired 16 straight hitters before slumping Derek Jeter led off with a single and O’Neill followed with a single in front of center fielder Steve Finley.

Up came Bernie Williams, and Yankees manager Joe Torre had no intention to bunt with his No. 3 hitter. Besides, Williams has not had a sacrifice since 1996.

Schilling and Johnson were named co-MVPs of the World Series, the first time the award has been shared.