NEW YORK (AP) — The perfect script.

Derek Jeter capped his Yankee Stadium farewell with a game-winning single in the bottom of the ninth inning, the latest storybook moment in a charmed and illustrious career, to give New York 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 at shortstop and drove in three runs. He launched an early double off the wall and saved the best for last — a sharp, opposite-field single to right that knocked in the winning run.