Derek Jeter went out at Yankee Stadium in style as he led New York to a walk-off win, while the San Francisco Giants booked a play-off spot.
In his last game in front of his adoring home fans, Jeter had RBIs " including the walk-off single " as the Yankees edged the Baltimore Orioles 6-5 in MLB.
Jeter singled to right field off pitcher Evan Meek to score Antoan Richardson and give the Yankees victory.
The retiring captain doubled and scored in the second inning and the Yankees looked on track for victory when they took a 5-2 lead in the seventh.
But Adam Jones' two-run homer and Steve Pearce's solo hit in the ninth put American League (AL) East champions the Orioles back in the game.
With one out in the bottom of the ninth, Jeter stepped up and Richardson scored from second in a fairytale ending.
The Milwaukee Brewers were eliminated from post-season contention, losing 5-3 to the Cincinnati Reds.
That meant the Giants were assured of a play-off spot before their 9-8 win over the San Diego Padres.
Pablo Sandoval had four RBIs in the Giants' win.
The Kansas City Royals rallied past the Chicago White Sox 6-3 to close in on a play-off berth.
The Oakland Athletics cling onto the AL wildcard but suffered a 2-1 loss to the Texas Rangers after Adrian Beltran's walk-off homer.
The Seattle Mariners are two games behind in the wildcard race and finally ended their five-match losing streak with a 7-5 win over the Toronto Blue Jays.
The Detroit Tigers are nearing the AL Central divisional title after a good performance from Max Scherzer helped them beat the Minnesota Twins 4-2.
The Pittsburgh Pirates are within a game of the National League (NL) Central lead after hammering the Atlanta Braves 10-1.
NL East champions the Washington Nationals split their series against the New York Mets.
The Nationals were 3-0 winners over the Mets, who claimed a 7-4 victory.
The Boston Red Sox thrashed the Tampa Bay Rays 11-1 and the Miami Marlins overcame the Philadelphia Phillies 6-4.