ST. PETERSBURG — Freddy Peralta delivered his best outing yet in a Tampa Bay uniform Sunday at Tropicana Field, allowing one hit over 4 2/3 innings, but a bullpen meltdown erased a 1-0 lead and handed the Rays another loss to the Baltimore Orioles.

Peralta threw 76 pitches — 40 strikes — and generated 12 swinging strikes, 11 of them on his four-seamer. He threw the fastball 52 times against just 24 secondary offerings, dominating a Baltimore lineup that managed only a soft single by Yohel Pozo while 14 of 18 batters were retired.

“All my pitches were working great. We were using the fastball a lot because we didn’t see any, like, really hard contact,” Peralta said. “They didn’t look comfortable at all. That’s why we kept using it, and I felt comfortable all the way.”

Manager Kevin Cash pulled Peralta after the right-hander walked two of the first three batters in the fifth, bringing in left-hander Garrett Cleavinger. Eight pitches later, Jackson Holliday delivered a game-tying single and Pete Alonso ripped a two-run double to erase the Rays’ slim advantage.

“He did a nice job for us. Just felt that, in that moment, it was a really big at-bat. He had done his job,” Cash said. “Very tough call, and certainly not happy or pleased with the way it worked out for him. You hate to see that happen.”

Peralta, who has worked extensively on his mechanics with pitching coach Kyle Snyder and bullpen coach Jorge Moncada since arriving at the trade deadline, said he felt the adjustments clicking. “I felt really good, really good in general, and I was feeling amazing mechanically, mentally, physically,” Peralta said. “Everything was in the spot that I want it to be.” Asked about Cash’s decision to pull him, Peralta was measured: “I respect his decision. He knows why he did it, and I respect his decision. That’s all I have to say about that.”

Outfielder Ryan Vilade provided the Rays’ lone bright spot, launching a 441-foot solo home run to center off Trevor Rogers in the fourth inning — Tampa Bay’s first lead through the first 28 innings of the series. Vilade also made a highlight-reel catch in the first, running down a Gunnar Henderson fly ball, slamming into the wall and starting an inning-ending double play.

The damage deepened after Peralta’s exit. Relievers Steven Matz and Joe Boyle combined to allow seven runs in a 59-pitch sixth inning that put the game out of reach. Cleavinger, who also factored in Friday’s loss, said the struggles are compounding. “It sucks. I’m kind of struggling to let things go right now, and this game has a funny way of kicking you when you’re down,” Cleavinger said. “It’s a tough one to swallow. I thought I made some decent pitches — they could always be better — but hopefully just move on to the next one.”

“In a 162-game season, you’re going to have three days like this. I’m not really thinking anything about it,” Vilade said. “We were in both those games earlier in the weekend, and this one kind of got away from us. We’ll be ready for tomorrow.”

The Rays, losers of six straight against Baltimore, face the Orioles in Monday night’s series finale at Tropicana Field needing a win to avoid a four-game sweep.