BALTIMORE (AP) -- The New York Yankees finished their season-opening trip with a feel-good victory that featured a late-inning comeback and a clutch bullpen performance.
Aaron Judge hit a tying home run, Starlin Castro's RBI single keyed a four-run ninth inning and the Yankees rallied to defeat the Baltimore Orioles 7-3 Sunday and avert a three-game sweep.
After avoiding their first 1-5 start since 1989, the Yankees headed north for Monday's game against Tampa Bay.
"It's good for us to have a game like this before going home and playing in front of our fans," manager Joe Girardi said. "We're all excited about that."
The Orioles started the day as the only unbeaten team in the majors at 4-0. After pulling off comeback victories in the first two games of the series, Baltimore blew a three-run lead in the finale.
Ronald Torreyes cut the gap to 3-2 with a two-out, two-run triple in the sixth, Judge homered in the eighth and the Yankees completed the turnaround against Darren O'Day (0-1) in the ninth.
Matt Holliday drew his career-high fifth walk and was replaced by pinch-runner Jacoby Ellsbury, who stole second. After Chris Carter walked, Castro bounced a single up the middle. Judge added a run-scoring groundout, Austin Romine hit a sacrifice fly and the final run scored on a throwing error by second baseman Jonathan Schoop.
Dellin Betances (1-1), who took the loss Saturday, struck out two in a perfect eighth and Aroldis Chapman worked the ninth.
New York relievers combined for three hitless innings after starter CC Sabathia gave up three runs -- two earned -- six hits and four walks over six innings.
"It's just the first week, but I felt like this was a game we needed to win," Sabathia said. "And we came out with the win."
Orioles starter Wade Miley walked seven, struck out five and allowed only one hit over five scoreless innings. He left a 3-0 lead, but the bullpen gave it away.
With Zach Britton and Brad Brach unavailable after pitching each of the previous two games, the five relievers summoned by manager Buck Showalter yielded seven runs and nine hits.
"I gave up a couple of hits, they got some runs," O'Day said. "It just wasn't a good outing. It was pretty bad."
Baltimore went up 2-0 in the second inning, taking advantage of two walks and getting RBIs from Trey Mancini and J.J. Hardy.
Mark Trumbo singled in an unearned run in the fifth.
YOU REMEMBER THE FIRST
Judge was thrilled to hit his first home run of the year, but that wasn't the best part of his day.
"The first one's always the toughest, to be honest. I'm more excited about the win," he said. "It's going to be great, going back to Yankee Stadium, seeing our fans for opening day in New York."
Yankees prospect Kyle Higashioka, a seventh-round draft pick in 2008, finally got his call-up to the majors when C Gary Sanchez was placed on the 10-day DL on Saturday.
"He was at dinner when he got the call and said he couldn't even eat his dinner," Girardi said. "I think he left it there. Hopefully, he caught up at some point with his eating habits."
RHP Edwin Jackson passed a physical in Baltimore on Friday, agreed to a minor league contract with the Orioles and will report to extended spring training.
Yankees: 1B Greg Bird said his bruised right foot felt good, but he was experiencing flu-like symptoms and did not play Sunday. Girardi did not rule out Bird playing in Monday's home opener against Tampa Bay. ... Girardi said Sanchez (right biceps strain) was feeling slightly better and will undergo tests on Monday in New York.
Orioles: Miley (respiratory infection) was activated from the disabled list and OF Joey Rickard was placed on the 10-day DL with a sprained left middle finger. The injury occurred Saturday when Rickard slid into 2B on an attempted steal.
Yankees: RHP Michael Pineda will start against the Rays in an afternoon matchup that launches a nine-game homestand.
Orioles: After taking Monday, off Baltimore begins its first trip of the season with a two-game series in Boston.
MORE ORIOLES: RANKING ALL 30 MLB LOGOS FROM WORST TO FIRST