NEW YORK -- Derek Jeter stood at first base and waved his batting helmet, cheers resonating from the upper reaches of a packed Yankee Stadium.
After tying Lou Gehrig atop the Yankees hit list, the ever-confident captain suddenly wasn't so sure of himself.
"I really didn't know what to do because we were losing at the time and I didn't want to disrespect Tampa," Jeter said. "I never dreamt about all of this."
Jeter broke out of his slump in a big way Wednesday night, getting three hits to match Gehrig's franchise mark, and New York rallied for a 4-2 victory over the Tampa Bay Rays thanks to a three-run homer by pinch-hitter Jorge Posada in the eighth inning.
Jeter tied Gehrig with 2,721 hits in a Yankees uniform, a mark the Hall of Famer had held by himself for more than 70 years.
"He's one of the classiest people to ever play this game," Jeter said during an on-field, postgame television interview pumped over the stadium public address system. "It's just kind of mind-boggling to have my name next to his."
Moments after Posada's homer, Jeter received a booming ovation as he stepped to the plate in the eighth with a chance to break the record. But he walked against reliever Grant Balfour, bringing a loud chorus of boos from the crowd.
The Yankees are off Thursday. Jeter gets his next chance to set the record Friday night at home against Baltimore.
"I have a pretty good feeling that it's going to happen pretty quickly," manager Joe Girardi said.
Shut down by rookie Jeff Niemann most of the night, the Yankees completed a four-game sweep and sent the AL champion Rays to their eighth consecutive loss. It's their longest skid since dropping eight straight in July 2007.
Already on their feet in anticipation, fans at Yankee Stadium let loose with a roar when Jeter's sharp grounder inside the first-base line got by a diving Chris Richard in the seventh.
Jeter's parents, watching from an upstairs box between home plate and first base, raised their arms and exclaimed in excitement.
"I felt proud. I got goose bumps," Posada said. "It was a perfect moment."
Jeter took off his helmet and twice waved it to the crowd of 45,848 during an ovation that lasted about 2 minutes. Rays players and coaches clapped as Jeter stood at first base.
"I'm very happy for him," Tampa Bay manager Joe Maddon said. "He carries himself in a manner that's worthy of passing Gehrig."
After entering the game in an 0-for-12 slump, his longest hitless stretch this season, Jeter snapped out of the rut with a bunt single toward third base leading off the bottom of the first. He beat the play without a throw, bringing a standing ovation from the crowd.
"That's why I bunted in the first inning. I needed to get one hit, right?" Jeter said.
With cameras flashing all around the ballpark on every pitch to Jeter, he grounded out in the third and drove a ground-rule double to straightaway center in the fifth.
On his first chance to tie Gehrig, Jeter came through in fitting fashion -- with an opposite-field hit on the first pitch.
"I don't want to say it was a relief," Jeter said. "Afterward I was pretty excited that I was able to do it tonight."
In the middle of the eighth inning, the large video board in center field showed a replay and flashed "Congratulations Derek!"
"What an ovation I got from the fans," he said. "I've been trying to do it for them."
Jeter also stole second base in the first inning for his 300th career steal, which ranks second on the franchise list behind Rickey Henderson (326).
Gehrig's final hit came on April 29, 1939, a single against the Washington Senators. The Iron Horse had held the club record for hits since Sept. 6, 1937, when he passed Babe Ruth.
Gehrig's career ended suddenly in 1939 because of illness. Two years later, he died at 37 from the disease that would later bear his name.
A key throwing error by Richard helped the Yankees rally in the eighth. Posada, one of Jeter's best buddies, connected off Balfour with one out to give New York a 4-2 lead and raised his arm as he rounded first base.
"It would be tough to lose a game when he ties Lou Gehrig, so we needed to win this one," Posada said.
Jonathan Albaladejo (5-1) pitched two scoreless innings for the win.
Lance Cormier (2-3) took the loss.
With the Yankees limiting Joba Chamberlain's workload this season, the 23-year-old right-hander was pulled after three innings for the third straight start.
Jeter was back at shortstop after a night as the DH. ... B.J. Upton (sprained left ankle) started in CF for the Rays but was lifted in the sixth and replaced by Fernando Perez. ... Jason Bartlett drove Chamberlain's fourth pitch to left for his second homer in two games and second career leadoff shot. Both have come this season at Yankee Stadium.
Reeling D-backs look to rebound against Reds
After a disastrous visit to New York, the Arizona Diamondbacks return home Friday facing an uphill climb for a National League wild-card berth.
Pitching rematch set when Rockies host Padres
Jeff Hoffman will forever be linked to Troy Tulowitzki, no matter which direction the right-hander's career takes. He was considered the key piece for the Colorado Rockies when they traded their All-Star shortstop to the Toronto Blue Jays in 2015.
Hot Brewers hope to gain ground on Cardinals
The National League playoff race will intensify when the red-hot Milwaukee Brewers visit the St. Louis Cardinals for a three-game series starting Friday night.
Mets' next test: Face NL-best Dodgers
The New York Mets proved they were still playoff contenders this week by sweeping a four-game series from the Arizona Diamondbacks. Beginning Friday, the Mets have to prove it all over again, this time against the best team in the National League.
Astros' Cole on mound to open series with Royals
The Houston Astros can't clinch the American League West Division title this weekend against the Royals in Kansas City, but they can take some big steps toward that goal.
Surging Indians ready to take on Twins
The Cleveland Indians have won four in a row to build steam heading into Friday's opener of their pivotal three-game series against the visiting Minnesota Twins.