BALTIMORE (AP) — The new wall in left field at Camden Yards served its purpose, denying Aaron Judge a home run on his 399-foot drive in the first inning.

“I learned my lesson and decided to go to right field after that,” he said.

The ballpark couldn't hold Judge's next two hits, a pair of solo homers that helped the New York Yankees to a 5-4 win over the Baltimore Orioles on Tuesday night. Judge and reliever Michael King were the biggest stars of this victory, New York's 20th in its last 23 games.

Judge came within a few feet of a three-homer game. His bid in the first hit high off the wall — which was moved back and made taller before this season. He settled for an RBI double, then went deep in the third and fifth to increase his major league-leading home run total to 14.

Judge added a single in the eighth for his third four-hit game and first since 2019.

Ramón Urías homered for the Orioles, who matched a season high with their fifth straight loss. Down 5-3, Baltimore managed a run against Aroldis Chapman in the ninth on a two-out double by Ryan McKenna. With men on second and third, Chapman retired Cedric Mullins on a foul pop for his ninth save in nine chances.

Jameson Taillon (4-1) allowed three runs in five-plus innings. King came on after a leadoff double in the sixth and retired all nine of his hitters with six strikeouts before giving way to Chapman.

After Urías tied the game at 1 with a homer in the second, Judge began hitting to parts of the ballpark that are unchanged this year. His home run to right-center made it 2-1 in the third. After a pair of Baltimore runs in the fourth, Judge tied it with a shot to center.

In the sixth, DJ LeMahieu came up with the bases loaded and one out against Dillon Tate (0-2) and put the Yankees ahead with a groundball. Baltimore then pitched to Judge with first base open, and he grounded out.

An error by Urías at shortstop with two out in the seventh gifted New York an unearned run that made it 5-3.

TIDBITS

Judge's two homers went 410 and 422 feet, according to Statcast, after his double was just under 400. Judge's reaction to the new dimensions at Camden Yards was about what you'd expect from a right-handed slugger.

“It's a travesty man. I'm pretty upset,” Judge said. “It looks like a create-a-park now. I didn't like it because I always like coming here and playing here. Hopefully maybe in a couple years they can put it back in.”

King induced 10 swings and misses, equaling the total by all of Baltimore's pitchers combined.

“He's been one of the best relievers in the league, especially considering the amount of innings we've been able to get from him,” manager Aaron Boone said. “Really impact innings.”

MOVES

Before the game, the Orioles designated LHP Logan Allen for assignment and optioned INF Rylan Bannon to Triple-A Norfolk. They selected the contract of LHP Nick Vespi and recalled RHP Logan Gillaspie from Norfolk.

Gillaspie pitched the final two innings, keeping the Yankees off the scoreboard in his big league debut.

TRAINER'S ROOM

Orioles: OF Austin Hays (hand) returned after missing four games. He misplayed Judge's drive in the first, allowing it to bounce past him off the wall, but he made up for that by throwing Judge out at third when the slugger tried for a triple.

UP NEXT

The Yankees send Gerrit Cole (3-0) to the mound Wednesday night against Jordan Lyles (2-3) of the Orioles. Cole has a 1.42 ERA over his last four starts.

___

Follow Noah Trister at www.Twitter.com/noahtrister

___

More AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP_Sports