Updated

Jorge Posada came off the bench and helped the Yankees to yet another first-place finish with a go-ahead single in the eighth inning, and New York swept the Tampa Bay Rays by identical 4-2 scores in a day-night doubleheader Wednesday to win the AL East.

Accomplishing most of their regular-season goals with a week to spare, the Yankees earned their 16th playoff berth in 17 seasons by winning the day game behind Robinson Cano's tiebreaking, two-run double in the eighth.

They didn't bother celebrating after that one -- Yankees blase at its best -- but vowed to let loose when they ensured the division crown. They made good on that promise, donning goggles and spraying the bubbly in the clubhouse.

"To clinch the American League East, it feels good," Posada said.

For the Rays, it was a damaging day as they missed a chance to move up on Boston in the AL wild-card race. The Red Sox lost to Baltimore 6-4, but still extended their lead over Tampa Bay to 2 1/2 games. The Los Angeles Angels also are 2 1/2 games behind.

The Yankees' clincher fell into place after a 62-minute rain delay. A month past his 40th birthday and his role reduced, Posada pinch-hit with the bases loaded and two outs with the score 2-all. He hit a hard, two-run single to right off Brandon Gomes and pumped a fist as he ran up the first-base line.

Posada admitted he lost track of the situation when he came up to the plate, saying, "I really thought it was the bottom of the ninth."

In the moment, the score also eluded the veteran All-Star, especially as pinch-runner Greg Golson and Mark Teixeira crossed the plate.

"When I saw Teixeira keep running, I thought we needed two runs," Posada said.

Posada's hit propelled New York to its 12th AL East title in 16 years and came about 50 minutes after the second-place Red Sox blew a three-run lead and lost. When Yankees reliever Rafael Soriano struck out Matt Joyce to end it, New York players -- in orderly fashion, of course -- streamed to the mound to finally celebrate.

In the night game, a makeup for a rainout last month, CC Sabathia failed in his bid to reach 20 wins for the second time in his career. Wasting a 2-0 lead, he allowed solo homers to No. 9 hitter Kelly Shoppach in the fifth and Sean Rodriguez in the seventh, the latter clanking high off the left-field foul pole.

Desmond Jennings singled with one out in the eighth, B.J. Upton singled on a liner off Sabathia's glove and Evan Longoria, down 0-2 in the count, worked out an eight-pitch walk.

David Robertson (4-0) relieved, and Ben Zobrist grounded into a 4-6-3 double play on his first pitch. After returning from the birth of a child, Zobrist had struck out in his first four at-bats of the twinbill.

Pinch-hitter Nick Swisher doubled off Jake McGee (3-2) with one out in the bottom half, and Curtis Granderson flied out. Juan Cruz came in and walked Teixeira on four pitches, and Cesar Ramos fell behind Cano 3-1 before walking him intentionally to load the bases for Posada.

Earlier, Cano sent a 76 mph curveball into the right-field seats in the second against rookie Jeremy Hellickson, and Jesus Montero hit a run-scoring, double-play grounder in the fourth. With Mariano Rivera unavailable after pitching in the opener, Soriano worked the ninth for the save.

In the opener, Eduardo Nunez hit a tying home run in the eighth against All-Star James Shields, and Cano followed with a double off J.P. Howell to clinch the Yankees' playoff spot.

They waited for a bigger celebration -- five World Series titles and seven American League pennants since 1996 for Derek Jeter, Rivera and Posada had numbed the Yankees and their fans to preliminary achievements.

Alex Rodriguez hit an RBI double in the first, but that was all the Yankees got off Shields (15-12) until the eighth. Jennings put the Rays ahead 2-1 with a two-run homer in the second inning off emergency starter Hector Noesi.

Nunez then hooked an 82 mph changeup into the first row of the left-field seats leading off the eighth. Brett Gardner singled with one out, Jeter walked, and that was it for Shields.

Howell relieved and fell behind 3-1, and Cano lined an opposite-field drive into the gap in left-center. In the dugout, Shields briefly put a towel over his head, unable to watch.

"Right now, it's crucial times, and we've got to win ballgames," Shields said. "I didn't get the job done."

Ominously, Yankees scheduled starter Phil Hughes was scratched and had an injection of painkiller in his back. General manager Brian Cashman anticipates Hughes will return to the mound next week during the final series of the regular season.

Luis Ayala (2-2), the seventh of eight Yankees pitchers, relieved with two on and two outs in the eighth and struck out his only two batters. Two days after setting the career saves record, Rivera was given a standing ovation when he entered. He closed it out 1-2-3 for his 44th save this season and the 603rd of his career, two more than Trevor Hoffman's old mark.

Rivera appreciated this playoff berth as much as the first one. He said players felt the Yankees were overlooked when predictions were made during spring training, after New York failed to sign Cliff Lee and Andy Pettitte retired.

"Nobody gave us a shot," Rivera said. "Here we are."

In the quiet clubhouse between games, there wasn't even a sign or a sound of a party going on in the inner sanctum back by the showers, where only the team is allowed.

Jeter, as usual, found a practical reason for not getting too worked up.

"We're going to spray champagne and then play the second game?" he said.

But a few hours later, it was time for the party to begin.

NOTES: No team had clinched a playoff berth in a doubleheader opener since the 1999 Red Sox, who chose to wait until after the nightcap to celebrate. ... The Yankees have never failed to finish first after opening a lead of at least 6 1/2 games. ... Swisher let go of the bat while swinging at strike three in the first inning, and the bat hit the side of Posada, who was standing 20 feet toward home plate from the on-deck circle. Posada, making his ninth appearance this year at first base, stayed in the game. ... Granderson, Teixeira and Russell Martin were given the afternoon off from New York's starting lineup in the opener; Jeter, Rodriguez and Swisher didn't start the nightcap. ... The Yankees are a big league-best 42-12 in day games. ... Rivera has converted 60 of 61 save chances against the Rays.