That was ugly.

Nestor Cortes allowed four home runs, including three straight in the third inning, in the Padres 7-5 loss to Baltimore.

The Orioles had already cemented a third straight series loss for San Diego. The sweep extends the Padres’ losing streak to four games. They are 2-8 in their last 10 games.

Once again Mike Shildt’s team faced an early deficit. Jackson Holliday took Cortes deep on his third pitch of the game. Things got out of hand two innings later. Colton Cowser lifted a three-run blast to put Baltimore ahead 4-0. A chorus of boos echoed after Colby Mayo and Alex Jackson followed with solo blasts of their own.

Cortes heard boos after stepping off the mound, having given up six runs in 2.1 innings.

His abbreviated start continues a frustrating trend. Padres starters have failed to reach six innings in nine straight games, averaging fewer than four innings pitched during that stretch.

Manny Machado got the Padres on the board in the sixth with a two-run homer. Two Padres batters came to the plate with the bases loaded and no outs in the frame. Jake Cronenworth hit an infield single and Jose Iglesias grounded into a double play, trimming the deficit to 7-4.

Fernando Tatis Jr. led the seventh off with a home run to get the Padres within two.

Wednesday’s game also featured a unique accomplishment. Mason Miller threw an immaculate inning in the eighth. He delivered nine sliders – all strikes – to retire the side in order. According to MLB.com Padres beat writer AJ Cassavell, it was the club’s first immaculate inning since Brian Lawrence did it in 2002.

The Padres visit the Rockies beginning Friday.