Atlanta: Pittsburgh clinched a spot in Major League Baseball’s play-offs by winning 3-2 at Atlanta on Tuesday, with Gerrit Cole steering the Pirates to victory by retiring the final 17 hitters he faced.

With the regular season into its final week, four play-off berths remain up for grabs.

Oakland received a setback with defeat at the hands of the Los Angeles Angels, dropping into a tie with Kansas City for the two wild-card spots in the American League.

The New York Yankees’ play-off hopes are all but over after losing to Baltimore, while San Francisco missed a chance to seal a National League wild card by losing to the Los Angeles Dodgers.

Pittsburgh’s win combined with Milwaukee’s loss to Cincinnati assured the Pirates of no worse than an NL wild card. They also closed within 1-1/2 games of NL Central leaders St. Louis.

Starling Marte gave Pittsburgh the lead with a sixth-inning double and the visitors hung on for their 11th win in 13 games.

The Angels won 2-0 at Oakland, staying 2-1/2 games clear of Baltimore for the overall best record in the AL and home advantage throughout the AL play-offs.

Oakland and Kansas City are both on 86-71, three games ahead of Seattle with five to play. The Royals won the season series against Oakland, so if they finish the season with identical records, Kansas City would host their one-game play-off.

Gordon Beckham homered for the Angels, who inflicted a seventh shutout on the Athletics since August 1.

Los Angeles’ Justin Turner homered twice and Matt Kemp had a two-run shot in a testy first inning to power the Dodgers to a 4-2 win over San Francisco.

The Giants slipped 4-1/2 games behind the Dodgers, who can wrap up the NL West title if they win the series finale on Wednesday.

San Francisco need one win from their remaining five games or Milwaukee to lose once in order to secure the wild card.

Baltimore’s Nelson Cruz hit his major league-leading 40th home run to help the Orioles edge New York 5-4 and push the Yankees to the brink of play-off elimination.

The Yankees fell five games behind the second AL wild card with only five games left.

Cruz is the sixth Baltimore play to post a 40-homer season, with the list topped by Chris Davis’ 53 last year.

Kansas City won 7-1 at Cleveland to keep the pressure on Detroit for the AL Central lead. Rookie pitcher Yordano Ventura (14-10) allowed only four singles over seven innings.

The Royals stayed within one game of the Tigers and need only one more win or a single Yankees loss to claim their first play-off position since winning the World Series in 1985.