When Adam Frazier came to bat with runners on second and third in the ninth inning, the first thought that crossed his mind was to fight.

Frazier had flied out, lined out and struck out in his first three at-bats, but the Pittsburgh Pirates were staging a last-gasp rally. With two strikes against Cleveland Guardians All-Star closer Emmanuel Clase, Frazier was looking to put the ball in play.

“Come up with two guys on and just try to put it in play with two strikes, for sure,” Frazier said. “It’s just move the line at that point. He’s got really good stuff, so you don’t try to do too much and see what we can do.”

Frazier drilled a knee-high cutter down the third base line for a two-run double to cut the deficit to one run. He hesitated to tag on Isiah Kiner-Falefa’s lineout to left but stole third base and scored the game-tying run on a Ke’Bryan Hayes single to right to force extra innings.

It was a big sequence for Frazier, who went 7 for 23 (.304) with three doubles, two RBIs, two runs scored and two stolen bases during the seven-game homestand. He also made some big defensive plays at second base, including a pair of inning-ending double plays and diving stops to rob Jose Ramirez of an RBI in the sixth inning on Saturday and another in the 10th inning in Sunday’s 5-4 loss.

“The game’s on the line right there,” Frazier said. “I’ve been reading Ramirez’s swings pretty good and he’s been turning and burning, so I played way over and it was good to get that one.”

That Frazier went 1 for 4 with a double, a stolen base, two RBIs and a run scored Sunday didn’t go unnoticed by Pirates manager Derek Shelton, nor did his defensive heroics.

“He played the complete game, getting the bag and he made the really nice diving play on the ball Ramirez hit,” Shelton said. “Very aware on the bases of, ‘OK, we can get a bag right there and score a run.’ Overall, I thought ‘Fraz’ played really well.”

With Nick Gonzales out since Opening Day with a nondisplaced fracture in his left ankle, Jared Triolo spending a stint on the 10-day injured list and Enmanuel Valdez needed at first base, the 33-year-old Frazier has been thrust into a prominent role for the Pirates this season. He’s played in 21 of their first 23 games, starting 16 at second base, one in left field and one in right field.

“I try to take advantage of the opportunity at any position, whether it’s at second base or left field or right field,” Frazier said. “Be ready when the team needs you. That’s what I’ve done my whole career. Hopefully, we get Nick back here soon. He’s going to help us win.”

Frazier, however, hasn’t picked up where he left off with the Pirates. He was batting .324 and leading the National League with 125 hits to earn All-Star honors for the first time before being traded to the San Diego Padres in July 2021. Frazier has never duplicated that success at the plate while playing for the Seattle Mariners, Baltimore Orioles and Kansas City Royals the past three seasons but he got valuable postseason experience with the latter three.

The left-handed hitter had been scuffling at the plate for the Pirates, especially during an eight-game stretch where he went 2 for 25 and saw his batting average nosedive to .159. He raised it by 50 points over the homestand but still has a below-average slash line of .209/.239/.299 with four extra-base hits, eight RBIs and five runs scored.

But Frazier’s defense has been solid, with two defensive runs saved at second base. Frazier has been particularly good at taking the cutoff and making strong throws to home plate. He saved a run Friday night when Kyle Manzardo doubled to right field, where Bryan Reynolds hit Frazier, who threw Ramirez out at the plate to end the third inning.

“That’s a good feeling as an outfielder, when you know you can just pick the ball up and find the first guy and hit him in the chest and let him do the rest,” Reynolds said. “That’s what I did (Friday), a quick turn and out of his glove quick.”

While Frazier hopes the homestand was a sign that his hitting is starting to come around, he’s hanging his hat on his defense until Gonzales is ready to return.

“I understand the importance of defense, especially when you’re not putting up a lot of runs,” Frazier said. “It’s even that much more important, so I try to make the plays and help the pitching staff out and relay the importance of that to the rest of the guys. If you can play a clean game, you’re usually in it until the end.”