BALTIMORE (AP) -- After losing two straight games to Toronto, the Baltimore Orioles broke out the big bats.
The Orioles tied a team record by with seven home runs to rout the Blue Jays 12-2 and stay within 1 1/2 games of the AL East lead.
Chris Davis and Manny Machado each connected twice and the Orioles remained close to the division-leading New York Yankees, who won 8-2 in Minnesota.
Nate McLouth hit a leadoff shot in the first inning and Jim Thome and Mark Reynolds also homered. Baltimore has hit seven home runs three times, most recently on Aug. 26, 1985.
''Home runs are very unique, and when you do what we did tonight, it's something to be proud of. It's something that doesn't happen a whole lot in the game,'' Thome said.
Thome's home run was the 612th of his career and the first he's hit at home for the Orioles.
''Up and down the lineup, everyone swung the bat well. It's been fun,'' Thome said.
Davis finished with a career-high five RBIs to help the Orioles split a four-game series with the last-place Blue Jays.
''This was a tough series. It was one of those ones that you don't want to see at the end of the season coming in off a long road trip,'' Davis said.
''I think if you'd have told us a few months ago that we'd be a game-and-a-half out with six games left, I think you'd be pretty happy with that.''
Beginning Friday, the Orioles have three games with Boston at home and three at Tampa Bay.
''We just got through playing Boston and we played them well. Obviously, the three in Tampa are going to be tough, but we're at a point where we still have a chance, so that's all you can ask for,'' Davis said.
The Orioles trailed 2-1 heading into the bottom of the fifth before hitting three home runs.
Thome led off with his third homer since joining the Orioles. With two outs, Machado hit his fifth of the year for a 3-2 Baltimore lead. All of Machado's home runs have come at home, and his drive was the Orioles' 200th homer of the year.
Davis' three-run drive gave the Orioles a five-run inning and finished Carlos Villanueva (7-7).
Villanueva equaled a career high by giving up four home runs.
''Those mistakes I made, they hit them with authority. They put the power stroke on them and made me pay for them,'' Villanueva said.
Machado and Thome are the first AL teammates to hit home runs in the same inning with an age difference of more than 20 years, according to home run historian David Vincent.
Thome is 42 and Machado is 20 - Thome's major league career began 10 months before Machado was born.
''That's crazy,'' Machado said. ''It's a pretty good stat. I remember when I used to watch (Thome) play when I was a little kid. Now to hit a home run in the same inning he did, just feels great.''
Davis hit his second home run in the seventh. On Aug. 24, he hit three home runs against the Blue Jays, also in a game started by Villanueva. He has 28 home runs.
Reynolds hit his 23rd homer in the sixth and Machado added a two-run shot in the eighth.
Miguel Gonzalez (8-4) allowed two runs and five hits in seven innings. He allowed Edwin Encarnacion's 42nd home run with two outs in the top of the first.
With one out in the fifth, J.P. Arencibia, who went 7 for 9 in the four-game series, doubled and scored on Anthony Gose's single.
NOTES: Orioles LHP Randy Wolf was put on the 60-day disabled list with a torn ligament in his left elbow. Baltimore purchased the contract of INF-OF Bill Hall from Triple-A Norfolk. Hall will provide outfield help while Lew Ford is out with a groin injury. ... Deion Sanders, in town for Thursday's NFL Network game between the Cleveland Browns and Baltimore Ravens, took batting practice with the Orioles before the game. Sanders, who played nine years in the majors, was an outfielder for Baltimore manager Buck Showalter in the minors while in the Yankees' organization. ... The Orioles are off Thursday and begin a three-game series with Boston on Friday. Baltimore RHP Chris Tillman (8-2, 3.08 ERA) faces Red Sox RHP Aaron Cook (4-10, 5.13). ... On Thursday, Toronto hosts New York to begin a four-game series. Blue Jays RHP Brandon Morrow (8-7, 3.28) faces Yankees RHP Ivan Nova (12-7, 4.94).