(CBS New York) — After a wild last week and last day to the season, the MLB playoff picture is finally determined. Here are the matchups going into the postseason:

American League:

READ MORE: 'When I Finally Got To Be Elvira, That's When My Life Calmed Down': Mistress Of The Dark Peels Back The Curtain

Wild Card: New York Yankees @ Boston Red Sox – Tuesday, October 5, 8:08 p.m. ET

Division Series: Chicago White Sox @ Houston Astros – starts Thursday, October 7

Division Series: Yankees/Red Sox @ Tampa Bay Rays – starts Thursday, October 7

National League:

Wild Card: St. Louis Cardinals @ Los Angeles Dodgers – Wednesday, October 6, 8:10 p.m. ET

Division Series: Atlanta Braves @ Milwaukee Brewers – starts Friday, October 8

Division Series: Cardinals/Dodgers @ San Francisco Giants – starts Friday, October 8

In the wild card game, the winner advances to the division round, while the loser goes home. Each ALDS season will be best of five games. This week’s Baseball Report looks at the American League and National League playoff picture ahead of the wild card games.

AL Playoff Picture

The AL wild card race came right down to the final game of the season, with four teams all vying for two wild card spots. The Yankees led the way most of the last week with a game or two lead on the Red Sox. But by Sunday, the two teams were tied at 91-70, with the Blue Jays and Mariners each one game back.

READ MORE: WATCH: Ghosts of Ybor City | 5 Part Series

The Yankees had already lost the first two games of a series with the Tampa Bay Rays, who had long since clinched the AL East. Another loss to the division winners could set up a potential game 163. Sunday’s game remained scoreless into the ninth inning. Aaron Judge hit a one-out single in the bottom of the inning to drive home the winning run. It was the slugger’s first walk-off hit in the majors.

The Red Sox needed a come-from-behind win to secure their spot in the wild card. For much of Sunday, it looked like Boston might need a 163rd game as well to have a shot at the postseason. But they rallied from 5-1 down to beat the Washington Nationals 7-5 and earn a playoff spot. They have the big bat of third baseman Rafael Devers largely to thank. He drove in four of Boston’s seven runs on the afternoon, including a two-run homer to put them ahead.

The Blue Jays kept pace as well, with a 12-4 win over the hapless Baltimore Orioles. George Springer led off the game with a home run, and Toronto never looked back. Springer would hit a grand slam later in the game as well. The Blue Jays needed the Yankees or Red Sox to lose to force a play-in game, but that didn’t happen. The Seattle Mariners, who lost Sunday, will also miss the postseason, stretching their playoff drought to 20 years.

The Yankees and Red Sox play Tuesday night in Boston for the privilege of facing the Rays in the ALDS. The Rays led the AL East for the last two months of the season and weren’t really challenged in September. They’re the only American League team to reach 100 wins.

The other ALDS series pits the Chicago White Sox against the Houston Astros. The White Sox have led the subpar AL Central for months as well. They finished off the season by winning six of their last seven games, but lost their season finale to the Detroit Tigers. The White Sox will travel to Houston to face the Astros. Division title already in hand, Houston held off the Oakland A’s in the final game of the season to finish with a record of 95-67. Their division series with the White Sox starts Thursday night.

NL Playoff Picture

The NL playoff race had its own excitement, as the two best teams in baseball (by record), fought for the division title in the West. The Giants have been the season’s biggest surprise, and they finished with MLB’s best record. Most experts had them limping to a distant third, as the Dodgers and San Diego Padres fought it out in September. Many thought they wouldn’t top 80 wins and certainly wouldn’t sniff the postseason. Instead San Francisco held baseball’s best record for 125 days and were MLB’s first team to clinch a playoff spot.

It took until the regular season’s final day to clinch the division though. The Giants won a franchise-record 107th game Sunday over a reeling San Diego club. The 11-4 win, helped along by Buster Posey‘s three RBI and two singles, including the 1,500th of his career, was their eighth win in the previous 10 games.

The Dodgers were in hot pursuit of their ninth consecutive division title. But now they are forced into a wild card game with the St. Louis Cardinals. The winningest second-place team in MLB history walked all over the Milwaukee Brewers Sunday. Their 10-4 win included Trea Turner’s second grand slam in three days. Turner secured the NL batting title and is a strong candidate for the NL MVP.

The Cardinals may be the hottest team in baseball at the moment. They beat the Brewers in six of seven games in the last couple weeks of the season, but couldn’t catch them in the division race. Losing two of the regular season’s final three games to the Chicago Cubs didn’t help. Their 90-72 record only earns them a trip to Los Angeles for a chance at an NLDS series with the Giants.

MORE NEWS: Atlanta Police Officer Recovering Months After Drunk Driver Slammed Into His Patrol Car

The other NLDS series will feature the Brewers and the Atlanta Braves. The Brewers closed the season with a 95-67 record after being swept by the Dodgers. The Braves shut out the New York Mets in the series’ rubber match to improve to 88-73. Their NLDS series starts Friday in Milwaukee.