NEW YORK (AP) This is what Gerrit Cole and the New York Yankees had in mind when they finalized the right-hander's free agent deal last December.

Cole pitched a seven-inning two-hitter, DJ LeMahieu led off the first inning with the first of three Yankees homers and New York beat the Baltimore Orioles 6-0 Friday in a doubleheader opener.

New York moved 2 1/2 games ahead of the Orioles for the AL's final postseason spot as the teams began a four-game series. The Yankees had lost 15 of 21 entering Friday amid a rash of injuries, dropping to third place in the AL East behind Tampa Bay and Toronto.

Cole (5-3) opened with 4 2/3 hitless innings before Hanser Alberto singled, although his effort wouldn't have resulted in a no-hitter regardless. Baseball Commissioner Fay Vincent chaired a committee in 1991 that voted unanimously to define no-hitters as games of nine innings or more that ended with no hits. Doubleheaders this year were shortened to a pair of seven-inning games to shorten time in ballparks during this pandemic-shortened season.

''Yeah, I wasn't really thinking about it,'' Cole said.

The Yankees' $324 million ace struck out nine and walked one, finishing his gem in 114 pitches. He induced 27 swings and misses, the fourth-most of his career, including the postseason, according to MLB.com. He got 11 misses with his fastball and 10 via slider.

Cole tied Cincinnati's Trevor Bauer for the major league lead with two complete games, and neither of Cole's lasted nine innings. The other was a rain-shortened, five-inning effort that beat Washington on opening night. He's (backslash)the first Yankees pitcher with two complete-game wins of less than nine innings in one season since Allie Reynolds in 1952.

''I was happy to be able to finish it for me personally, but also for the rest of the balance of the bullpen for the rest of the day,'' Cole said. ''It's just nice to put a bow on it, I guess.''

Renato Nunez got the Orioles' second hit when he singled with two outs in the seventh. Jose Iglesias nearly had a hit for Baltimore in the fourth, but right fielder Clint Frazier dived and caught it.

Cole had lost three straight starts for the first time since 2018, including an outing last Saturday at Baltimore. He's never lost four straight.

''It really just solidified in my mind about all the things, all the intangible things we thought we were getting when we signed him,'' manager Aaron Boone said about the way Cole handled the stretch.

LeMahieu, Brett Gardner and Kyle Higashioka homered off starter Alex Cobb in his return from the injured list. The right-hander had been sidelined since Aug. 29 for undisclosed reasons. Cobb said postgame he had a cold and stayed away from the team as a coronavirus precaution, although he didn't have COVID-19.

LeMahieu greeted Cobb (1-4) with his fourth leadoff homer this season, tying the Cubs' Ian Happ for the major league lead. Luke Voit singled and Gardner followed with a two-run shot, ending a run of 11 consecutive solo home runs for the slumping Yankees.

Higashioka added his two-run homer in the second. It was the first homer this season for New York's backup catcher, who has been getting more playing time amid Gary Sanchez's struggles. Sanchez was the designated hitter and went 0 for 2 with a walk; his .119 batting average is the lowest in the majors among players with 100 or more plate appearances.

New York hit eight balls at least 90 mph against Cobb over the first two innings, according to MLB's Statcast.

''They weren't necessarily great pitches, but the swings they put on them, I didn't think they were home runs,'' Cobb said. ''I didn't think the swings were home run worthy.''

Cobb settled somewhat after that, getting five of his next six outs via strikeout. He was lifted after four innings trailing 5-0.

Mike Tauchman added an RBI single for the Yankees against Thomas Eshelman in the sixth.

The teams played a doubleheader after Thursday's series opener was postponed by rain.

NEVER FORGET

Boone, Gardner and general manager Brian Cashman visited the 9/11 Monument on Friday and laid a wreath on the 19th anniversary of the terrorist attacks. Yankees players and coaches wore NYPD and FDNY hats throughout the doubleheader, and a moment of silence was observed before Game 1.

TRAINER'S ROOM

Orioles: Cobb was added to the roster as Baltimore's 29th man for the doubleheader. Manager Brandon Hyde said the team will demote a different player before Saturday.

Yankees: OF Aaron Judge (right calf) and DH Giancarlo Stanton (left hamstring) could report to the team's alternate site for at-bats this weekend, putting them on track to return to the lineup by next weekend. ... LHP James Paxton's status remains unclear following a setback in his recovery from a flexor tendon strain in his throwing arm. Boone said there's ''still a chance on some level'' that Paxton pitches again this season, and said it's possible the 31-year-old could return as a reliever. Paxton can become a free agent after the season. ... RHP Jonathan Loaisiga (non-COVID, unspecified medical issue) was set to throw a bullpen Friday and another Sunday with the expectation he could rejoin the bullpen Tuesday.

UP NEXT

Yankees RHP Masahiro Tanaka (1-2, 3.38) opposes Orioles LHP Keegan Akin (0-0, 2.08) in Game 2.

---

Follow Jake Seiner: https://twitter.com/Jake-Seiner

---

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports

Copyright 2020 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.