Things got crazy in the Twins dugout around the 10th inning Friday as their struggling offense matched up with Houston’s.

The Twins were running out of bench players, so pitchers began putting their cleats on and reporting for extra duty.

‘‘Panic mode,” second baseman Brian Dozier said. ‘‘Pitchers love that stuff. They think they can hit.”

As it turned out, they just needed to bunt.

Righthander Kevin Correia came on in the 13th inning and laid down a perfect sacrifice bunt, moving Clete Thomas to second base. That was all Dozier needed, as he stroked a single to right, scoring Thomas with the winning run as the Twins beat the Houston Astros 4-3.

Correia became the seventh Twins pitcher to make a plate appearance in an American League game with the designated hitter, the first since Bobby Korecky hit a single off Texas’ Frank Francisco on May 19, 2008.

Correia almost didn’t bat. Mike Pelfrey was on deck while Thomas batted. Despite Pelfrey’s .098 career batting average, Twins manager Ron Gardenhire was hoping Pelfrey could come up with a big hit.

He had to rush into the clubhouse and put on his contacts first.

‘‘I put them in like four minutes before,” Pelfrey said. ‘‘I was warming up with a little soft toss.”

But when Thomas walked, Gardenhire went to Correia, considered the best bunting pitcher. Who knew how specialized the Twins could get with their pitchers?

‘‘I had four pitchers telling me they were ready to hit a home run,” Gardenhire said.

Correia missed the first pitch, but dropped a perfect bunt on the second pitch.

‘‘It’s fun,” Correia said. ‘‘We don’t get that opportunity anymore at the plate being in the American League. We’re normally sitting there just as spectators four days a week. So it’s fun to get in a game, especially if you can help your team get a win.”

Dozier was the hero for his second clutch hit of the long, long night.

The Twins tied the score at 2-2 in the eighth when Dozier doubled and Justin Morneau lined a single to center.

Glen Perkins went to the mound for the ninth. L.J. Hoes, traded to Houston on Wednesday as part of a package for starter Bud Norris, ended a nine-pitch at bat with a bloop single to right. Then Matt Dominguez, rocked a Perkins pitch to left for an RBI double, giving Houston a 3-2 lead.

Chris Colabello led off the bottom of the ninth with a walk off reliever Josh Fields and was replaced by pinch runner Doug Bernier. Thomas bunted Bernier to second. Chia-Jen Lo replaced Fields and threw a wild pitch, allowing Bernier to advance to third. Chris Herrmann walked, putting runners on first and third.

Dozier then dropped a single into center, scoring Bernier with the tying run and forcing extra innings. He would come through again four innings later.

‘‘You just have to find a way to win,” Gardenhire said. ‘‘And Doz got the big hit.”