Derek Jeter capped his goodbye to Yankee Stadium with a perfect storybook ending – a game-winning hit in the bottom of the ninth inning to give the New York Yankees a 6-5 victory Thursday night over the Baltimore Orioles.

Serenaded with adoring chants that echoed through the Bronx night, Jeter tipped his cap several times to the crowd in appreciation and drove in three runs. He launched an early double off the left-center wall and saved the best for last, a sharp, opposite-field single to right that knocked in the winning run.

After the pandemonium that followed in which teammates rushed the field to celebrate, Jeter told reporters played his final game at shortstop, but he'll likely play in some capacity this weekend in Boston.

It appeared Jeter's tiebreaking grounder in the seventh would be the swing that sent the Yankees to a victory when they built a 5-2 cushion against the AL East champions.

Not bad — but not Jeter.

Jeter has always had a flair for the most electrifying kind of drama, and this night was no different.

As if it was planned all along, closer David Robertson gave up a two-run homer in the top of the ninth to Adam Jones and a tying shot to Steve Pearce with two outs.

That only set the stage for Jeter one more time.

Jose Pirela hit a leadoff single in the bottom of the ninth against Evan Meek and advanced on Brett Gardner's sacrifice. Jeter lined the next pitch through a huge hole on the right side, and pinch-runner Antoan Richardson slid home ahead of Nick Markakis' throw.

An elated Jeter jumped and raised both arms between first and second. Yankees players rushed out to engulf him as former teammates such as Jorge Posada, Mariano Rivera, and Hall of Fame manager Joe Torre lined up near the New York dugout waiting to greet the retiring captain.

"It was above and beyond anything that I've ever dreamt of," Jeter said.

Jeter pointed and waved to the crowd as he walked out to the position he manned for 20-seasons. In an image seen before nearly every one of his 1,391 games at Yankee Stadium, Jeter faced the outfield and crouched down for a moment of reflection.

He then answered a few questions, said hello to his family who moved to the front row near the Yankees dugout for the final two innings, and greeted the teammates he won five World Series championships with.

Once more he took a slow walk across the diamond, covering his face with a towel several times and waving to the crowd as they chanted his name and "Thank you, Jeter!"

All across the majors, players saluted the 40-year-old star.

"Wow," Boston slugger David Ortiz said, breaking into a grin and shaking his head after the Red Sox beat Tampa Bay. "That's him. Perfect. It was unbelievable."

Moments after Detroit beat Minnesota to move a step closer to winning the AL Central, the Tigers' clubhouse at Comerica Park came to a near-standstill in the aftermath of Jeter's winning hit. Many players simply stood in silence and watched the postgame scene unfolding in New York on TV.

"You could see it coming when the inning started," reigning AL Cy Young winner Max Scherzer said. "We were sitting in the lunchroom. It was like, `Jeter's hitting third. He's going to walk it off.' We knew it."

The Associated Press contributed to this report.