Masahiro Tanaka allowed three solo home runs but not much else, and the Yankees completed a three-game sweep of the Baltimore Orioles with a 9-3 win Thursday in the Bronx.

Tanaka (7-3, 3.64 ERA) went 72/3 innings, allowing four hits and striking out seven on 101 pitches. An error charged to Brett Gardner, who lost Chris Davis' fly ball in the sun in the fourth, will be reviewed by the official scorer after the game.

Since a rough two-start stretch in which he allowed 11 earned runs in 10 innings against Detroit and Houston, Tanaka has given the Yankees four straight quality starts. He has allowed 10 earned runs on 17 hits and four walks while striking out 25 in 281/3 innings during that stretch.

The outings against the Tigers and Astros were Tanaka's fourth and fifth after his June 3 return from the disabled list (right wrist tendinitis/forearm strain).

"We feel good about when he takes the mound," manager Joe Girardi said before the game. "He had a couple tough starts, which is not abnormal when you come back from an injury and it's just not abnormal in the game of baseball. For the most part, he's been pretty consistent."

Tanaka recorded three strikeouts with the splitter, fooling Jimmy Paredes and Adam Jones into chasing pitches that dropped well below the zone.

"When he has the [splitter] for strikes and the one where he can expand the zone," Girardi said, "it just makes him that much tougher on the hitter."

The win put the Yankees 12 games over .500 for the first time this season, but more importantly, it extends their lead over second-place Toronto to six games. The Blue Jays face Oakland this afternoon. Baltimore, the 2014 American League East champion, fell to 46-48 and seven games out of first.

"These are important games," Girardi said, "because it allows you to separate yourself, and you don't have to rely on somebody else."

The Yankees, who came in leading the majors with 82 first-inning runs, staked Tanaka to an early 4-0 lead.

Jacoby Ellsbury led off with a single, and walks by Gardner and Alex Rodriguez loaded the bases with no outs. Ubaldo Jimenez (7-6) nearly escaped, striking out Mark Teixeira and getting Carlos Beltran to pop out to shallow left, but Chase Headley scorched a double to center to clear the bases.

Rodriguez would likely have been out with a better relay from second baseman Jonathan Schoop or a clean catch by Matt Wieters, who couldn't hang on to a throw that dragged him up the third-base line. His path obstructed by Wieters, Rodriguez tumbled home.

Didi Gregorius (3-for-4, RBI) singled through the right side to score Headley (2-for-4, three RBIs).

Tanaka allowed a home run to Davis leading off the second but needed only 12 pitches that inning.

Ellsbury, who entered with five hits in nine at-bats against Jimenez, led off the Yankees' second with a home run to right. His sacrifice fly with one out in the third, coming right after Stephen Drew's RBI double that chased Jimenez, gave the Yankees a 7-1 lead.

Ellsbury (3-for-4, four RBIs) added a two-run double in the fifth.

Solo shots by J.J. Hardy and Manny Machado in the eighth made it 9-3, ending Tanaka's day with two outs in the eighth.