ATLANTA: Pittsburgh clinched a spot in Major League Baseball’s playoffs 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 playoff 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’ playoff 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 leader 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 playoffs.

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 playoff.

Gordon Beckham homered for the Angels, who inflicted a seventh shutout on the Athletics since Aug. 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 needs one win from its 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 playoff 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 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 playoff position since winning the World Series in 1985.

Washington beat the New York Mets 4-2 but lost center fielder Denard Span to an injury suffered in taking a diving catch in the third inning.

Span is a key player for the Nationals. A strong defensive presence and their leadoff hitter, he entered with the club’s highest batting average at .298 and most stolen bases with 31.

The win boosted the Nationals’ push for home-field advantage during the NL playoffs. They are three games ahead of the Dodgers.

Toronto’s Dalton Pompey hit his first major league homer as the Blue Jays won 10-2 to further dent Seattle’s fading wild-card hopes.

Seattle lost its fourth straight thanks to another poor effort by a starting pitcher, with ace Felix Hernandez matching his career worst by giving up eight earned runs. Mariners starters have failed to complete five innings in any of the past four games, allowing 27 earned runs over 14 2-3 innings.

The Mariners fell three games out of the second AL wild-card spot with five games remaining.

Despite the win, Toronto was eliminated from playoff contention when Kansas City beat Cleveland.

Detroit’s Miguel Cabrera drove in the winning run with a single in the bottom of the ninth, giving the Tigers a vital 4-3 win over the Chicago White Sox.

The win kept Detroit a game ahead of Kansas City atop the AL Central and closer to the back-up of a wild-card berth.

Ian Kinsler started the bottom of the ninth by bouncing a single over the third baseman’s head. Torii Hunter walked, then Cabrera lined a single to left field, with Kinsler scoring from second.

The Chicago Cubs won 4-3 over St. Louis, with Welington Castillo hitting a homer and driving in the winning run with a 10th-inning single.

Cincinnati pushed Milwaukee to the verge of elimination from the playoff race with winning 3-1, with pitcher Johnny Cueto notching his 19th win of the season.

Miami’s Henderson Alvarez pitched into the eighth inning to outduel Cole Hamels and steer the Marlins to a 2-0 victory over Philadelphia.

Tampa Bay’s Ben Zobrist had three hits and drove in Tampa Bay’s first two runs during an eighth inning rally that lifted the Rays past Boston 6-2.

Colorado’s Drew Stubbs hit a tiebreaking home run leading off the eighth and left fielder Brandon Barnes took a tie-preventing catch in the bottom of the ninth to give the Rockies a 3-2 win against San Diego.

Texas’ Nick Martinez pitched 6 2-3 scoreless innings to guide the Rangers past Houston 2-1.

Minnesota’s Kyle Gibson matched a career high with eight strikeouts as the Twins beat Arizona 6-3.