– J.D. Martinez wanted that fourth home run. He had never even hit two in a major league game before, so might as well tie the record the first time he got a chance.

In his final at-bat, Martinez swung at a pitch out of the strike zone and popped up to right field in the eighth inning. It was just about the only time he missed Sunday, when he hit three homers and drove in six runs to lead the Detroit Tigers over the New York Yankees 12-4 to snap a four-game skid.

“I definitely got anxious. I just knew that I was feeling good,” he said. “I don’t think he threw me one strike.”

Victor Martinez homered and drove in four two-out runs off Masahiro Tanaka for Detroit, which was outscored 21-5 in the first two games of the series. Andrew Romine hit Jose De Paula’s first major league pitch for a solo shot in the sixth.

J.D. Martinez connected off Tanaka (4-3) with two outs in the first. He struck out looking in the third and led off the fifth with another homer against the Japanese righthander, who gave up three long balls for the first time in his big-league career.

Martinez then went deep off Danny Burawa with two on in the sixth to give the Tigers an 11-2 lead. Burawa was making his major league debut.

“It was just one of those days where you take swings and you’re actually hitting the ball how you want to hit it,” he said. “There’s not too many of those days, so you’ve just got to take advantage of them.”

He became the first Tigers player to connect three times against the Yankees since Charlie Maxwell in 1959.

“It’s pretty cool just to say the first time you did it was here,” Martinez said. “This is the pinnacle of baseball.”

Anibal Sanchez (6-7) was steady for seven innings to earn his third victory in a row, giving up seven hits and three runs in handing the Yankees only their second loss in 13 home games.