NEW YORK — The New York Yankees wiped out an early three-run deficit Tuesday night to overpower the Minnesota Twins 8-4 in the AL wild-card game.

The Yankees, who smacked three home runs, advance to the AL Division Series starting Thursday night in Cleveland.

The Yankees’ bullpen bailed out starter Luis Severino, who didn’t make it out of the first inning. In 82/3 innings, the Yankees’ bullpen allowed five hits and one run. Chad Green pitched two innings, David Robertson 31/3, Tommy Kahnle 21/3 and Aroldis Chapman one.

Severino allowed three runs and four hits, including two home runs, and a walk as Minnesota built 3-0 lead. Green relieved with runners on second and third and one out, but struck out Byron Buxton and Jason Castro to keep the deficit at three.

The Yankees tied the game in the first. Brett Gardner walked, Aaron Judge singled and Didi Gregorious launched a three-run homer to right to tie the game.

Gardner gave the Yankees a 4-3 lead with a second-inning home run to right field.

The Twins tied the game in the top of the third, but the Yankees took the lead for good on an RBI single by Greg Bird in the bottom of the third that scored Gary Sanchez, who started the inning with a double.

Judge hit a line-drive, two-run homer in the fourth inning to make it 7-4. Aaron Hicks walked with the bases loaded in the seventh to make it a four-run game.

Buxton was replaced in center field during the fourth inning because of tightness in his back.

Zack Granite entered for Buxton to begin the bottom of the inning.

Buxton grimaced in pain after crashing into the fence on a highlight-reel catch in the second.

He tracked Todd Frazier’s deep fly ball and made a leaping grab, slamming back-first into the wall before tumbling to the ground.

He stayed on his back momentarily before getting up and staying in the game.

Buxton drove in a run with a groundout in the third.