It had been a while since the Baltimore Orioles celebrated a victory, so forgive them for getting carried away after finally nabbing their 40th win of a very long season.

Rookie Hunter Harvey got a ride in a laundry cart and wheeled into the shower, where he got drenched in the wake of his first big league victory.

The celebration was put into motion after the Orioles used Hanser Alberto’s tiebreaking three-run homer in the eighth inning to beat the Kansas City Royals 4-1 Tuesday night, ending an eight-game skid.

Royals reliever Jacob Barnes (1-2) sandwiched a pair of walks around two outs before Alberto hit a 1-1 pitch into the Baltimore bullpen for his eighth home run. As the ball cleared the wall, Alberto raised his right arm in the air and smiled broadly approaching second base.

Harvey (1-0) worked a perfect eighth, notching two strikeouts in his first appearance at Camden Yards.

Mychal Givens got three outs for his 10th save.

Baltimore had lost 13 of its previous 14 games, including the series opener to Kansas City on Monday.

Both starters were very sharp, and neither factored in the decision.

Dylan Bundy allowed the Royals one run and five hits over seven innings with seven strikeouts.

Brad Keller didn’t let a runner get past first base until the sixth, when Chance Sisco drew a leadoff walk and went to second on a single. With one out, right fielder Bubba Starling ran far to his right to make a diving catch of a sinking liner by Anthony Santander, and Keller finished his outing by retiring Renato Nunez on a fly ball.

Keller gave up three hits and left with a 1-0 lead, but his bid to earn his first win since July 24 ended when reliever Richard Lovelady allowed a game-tying single to Rio Ruiz in the seventh.

Royals manager Ned Yost wants to limit Keller’s activity to preserve his arm for when Kansas City’s rebuild pays off.