The New York Yankees and Boston Red Sox won their final games of the 2021 season to clinch spots in the single-elimination American League wild-card game.

It took the Yankees until the very end to put a run on the Tampa Bay Rays.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

Rougned Odor singled to start the bottom of the ninth inning, and Tyler Wade pinch-ran for him. Wade moved to second base on a Gleyber Torres sacrifce fly. An Anthony Rizzo single moved Wade to third base while Rizzo took second on an errant throw to the catcher.

New York Yankees' Tyler Wade scores on a game-winning RBI single by Aaron Judge during the ninth inning of a game against the Tampa Bay Rays Sunday, Oct. 3, 2021, in New York. The Yankees won 1-0.

New York Yankees' Tyler Wade scores on a game-winning RBI single by Aaron Judge during the ninth inning of a game against the Tampa Bay Rays Sunday, Oct. 3, 2021, in New York. The Yankees won 1-0. (AP Photo/Frank Franklin II)

With two runners on, the Rays chose to pitch to Aaron Judge. The lumbering outfielder hit a liner off the mound, and it was enough for Wade to race home and score the game-winning run.

New York Yankee Aaron Judge, right, gestures to fans after a game against the Tampa Bay Rays Sunday, Oct. 3, 2021, in New York. The Yankees won 1-0.

New York Yankee Aaron Judge, right, gestures to fans after a game against the Tampa Bay Rays Sunday, Oct. 3, 2021, in New York. The Yankees won 1-0. (AP Photo/Frank Franklin II)

YANKEES' GIO URSHELA RUNS FULL SPEED TO CATCH FOUL BALL, DIVES INTO RAYS DUGOUT: 'VERY JETER LIKE'

The Red Sox needed to come back from a 5-1 deficit against the Washington Nationals.

Rafael Devers provided the heroics in the top of the ninth. With Kyle Schwarber on base, Devers hit a go-ahead home run, and Boston won 7-5. It was Devers’ 38th home run of the season, and it couldn’t have come at a better time.

The results nullified any hopes of the Toronto Blue Jays and Seattle Mariners making the playoffs.

New York and Boston will now meet in the American League wild-card game Tuesday at Boston's Fenway Park at 8 p.m. ET.

Boston Red Sox' Rafael Devers tosses his bat and celebrates his two-run home run during the ninth inning of a game against the Washington Nationals, Sunday, Oct. 3, 2021, in Washington. The Red Sox won 7-5.

Boston Red Sox' Rafael Devers tosses his bat and celebrates his two-run home run during the ninth inning of a game against the Washington Nationals, Sunday, Oct. 3, 2021, in Washington. The Red Sox won 7-5. (AP Photo/Nick Wass)

CLICK HERE TO GET THE FOX NEWS APP

The Yankees recently swept the Red Sox to help get them here.