Andy Pettitte retired his first 20 batters before a lamentable seventh-inning sequence spoiled both his perfect game and no-hit bid, and the Yankees beat the Orioles 5-1.
Pettitte (12-6) was poised to finish the seventh without allowing a base runner, but former Oriole Jerry Hairston Jr. let a two-out grounder by Adam Jones slip through his legs for an error. Hairston was playing in place of Alex Rodriguez, who was given the night off.
Nick Markakis followed with an opposite-field single inside the third-base line, drawing further groans from a crowd of 25,063 filled with Yankees fans.
After Melvin Mora led off the eighth with a home run, Pettitte completed his masterful effort by getting three straight outs.
The 37-year-old Pettitte took his dominance of the Orioles to a new level with a vintage pitching gem that enabled him to move into sole possession of third place on the Yankees career wins list. He broke a tie with Lefty Gomez with his 190th victory with New York, a number bested by only Hall of Famers Whitey Ford (236) and Red Ruffing (231).
Pettitte allowed one run and two hits, struck out eight and walked none to improve to 4-0 in his last seven starts. He's 26-6 lifetime against the Orioles.
It was the first time Pettitte went eight innings since July 20, 2008.
Brian Bruney gave up a walk and a single in the ninth before Mariano Rivera got two outs for his 37th save - and career-best 33rd in a row.