BOSTON — At times Friday, the Orioles played like a Little League team in a 19-5 loss to the Red Sox.

They made four defensive blunders, gave up 18 runs in three innings and had a position player turn a blowout into an abomination.

On Sunday, the Orioles turned the tables and made the Red Sox play embarrassing baseball. Ryan O’Hearn’s Little League home run in the eighth — a double that he scored on after two errors — capped off an Orioles 5-1 win at Fenway Park.

The victory was one of the ballclub’s most complete this season, featuring a solid start, consistent offense and a lockdown bullpen. Dean Kremer tossed 5 1/3 scoreless innings, his bullpen was just as good and Baltimore’s bats put up at least one run in four innings.

“They should count that Little League homer for real, but it’s not gonna happen,” O’Hearn quipped. “It was a good day for everybody — maybe the most complete game that we’ve played in a while. So very proud of that, and happy we saved the series.”Baltimore improves to 18-34 with the win after splitting the series with Boston. Sunday marked only the second time this season the Orioles have won consecutive games and the first since May 1. A win Monday over the St. Louis Cardinals would be their first time winning three straight this year.

“Any time you win two straight, there’s some momentum,” said Tony Mansolino, who improved to 3-6 as interim manager after skipper Brandon Hyde was fired May 17. “As a vibe, these guys always have the good vibes. Just a little bit of momentum with a couple wins, and hopefully we can carry it into Camden against the Cardinals.”

Kremer carried the baton after left-hander Trevor Rogers twirled 6 1/3 scoreless innings in Saturday night’s 2-1 victory to split the doubleheader. The 29-year-old right-hander scattered seven hits but was able to escape jams thanks to four strikeouts and a little help from his defense, namely a stellar play in right field from Dylan Carlson.

Kremer struggled as he always does in April with a 7.04 ERA, but he’s been stellar in May with a 2.97 ERA in five starts. The Orioles have received four scoreless starts from a member of the rotation this year, and Kremer has two of them after he tossed seven spotless frames versus the Kansas City Royals earlier this month.

Ramón Urías gave Baltimore a 1-0 lead in the fourth inning with a sacrifice fly off Red Sox starter Walker Buehler. Dylan Carlson, who smacked two hits Saturday night, blasted a solo shot in the fifth, and O’Hearn, who raised his season average to .329 in the win, launched a solo homer in the sixth to give the Orioles a 3-0 lead. O’Hearn’s Little League homer in the eighth brought home two runs thanks to errors by center fielder Ceddanne Rafaela and shortstop Marcelo Mayer, a top prospect the Red Sox promoted Saturday.

“It was fun,” O’Hearn said the reaction from his teammates in the dugout after he scored. “Stuff like that, baseball’s a crazy game. Things happen that you haven’t seen before. I don’t think I’ve ran full speed around the bases like that in a long time.”

After his 3-for-3 afternoon, the 31-year-old slugger has been one of the hottest hitters in baseball with a .360 average and 1.030 OPS in his past 25 games. Among qualified American League hitters, O’Hearn ranks in the top five in batting average, on-base percentage and OPS.

“He’s been unbelievable,” Mansolino said. “He’s really carried us here the whole year. He’s been awesome.”

Relievers Gregory Soto, Keegan Akin, Bryan Baker and Andrew Kittredge combined to strike out four batters and allow only one run in their 3 2/3 frames. The bullpen imploded in Friday’s loss, but under difficult circumstances with a doubleheader Saturday and a day game Sunday, the group pitched well, allowing only two earned runs in 10 2/3 frames.

Amid the tumultuous start, each win has served as a glimmer of hope that maybe this club’s fortunes are finally starting to turn around. This weekend in Boston is far from proof of that, but it’s perhaps the most encouraging sign all month.

Postgame analysis: There are no moral victories in the big leagues. There certainly aren’t for a last-place team that was expected to be a playoff contender.

However, if anyone is in the mood for silver linings, the Orioles did play better baseball this week. There was still sloppy play, to be sure, but six of Baltimore’s seven games this week were close. The only one that wasn’t was the laughable 19-5 loss Friday, and even in that one, the Orioles led 2-1 in the sixth inning. On Tuesday, the Orioles suffered their eighth straight loss. Since, they’ve won three of five.

Legendary football coach Bill Belichick was famous for saying, “You can’t win until you keep from losing.” The Orioles, for the most part, did the latter this weekend in Boston. Whether they can continue to do the former remains to be seen.

What they’re saying: Kremer on if the team has turned the page after the departures of Hyde, catching instructor Tim Cossins and starting pitcher Kyle Gibson last weekend:

“I think that it’s in the back of some guys’ mind, I’m sure. For myself, appreciate everything that Hyder and Cossy have done for us, and Gibby. He’s a superhero in my eyes. It’s a long season, got to be able to move on and kind of keep your head down and take it one at a time.”

By the numbers: The Orioles sport one of baseball’s worst starting rotations, entering Sunday with an AL-worst 5.72 ERA. Inconsistent starting pitcher is perhaps the main reason Baltimore finds itself in the cellar.

But the group largely pitched well this week with a 3.00 ERA and good starts from Kremer, Rogers, Tomoyuki Sugano and Cade Povich. A turnaround for this team is unlikely, but if it’s possible at all, the rotation will need to pitch more like it did this week.

“They were great, man,” Mansolino said. “This isn’t an easy yard to pitch in. It’s a tough lineup. Starting pitching has been great here recently. We’ve got a long way to go, we’ve got some options right now and we’re excited about those guys.”

On deck: Charlie Morton was originally scheduled to start Friday against the Red Sox, but two rainouts and a doubleheader changed those plans. After being in the bullpen this weekend as a long relief option, the 41-year-old will take the ball Monday at Camden Yards versus the Cardinals — his first start since May 7 when he dropped to 0-7. In three relief outings since, Morton has posted a 1.93 ERA and 35.3% strikeout rate across 9 1/3 innings. Sugano and Povich will start Tuesday and Wednesday, respectively.

Have a news tip? Contact Jacob Calvin Meyer at jameyer@baltsun.com, 410-332-6200 and x.com/JCalvinMeyer.