Tommy Hunter #35 poses for a portrait during the Texas rangers Photo Day at Surprise on March 2, 2010 in Surprise, Arizona.
The AL West-leading Rangers had lost 11 of 15 before the victory, which also snapped a 1-7 stretch on the road.
Luke Scott hit his 100th career homer and Ty Wigginton also connected for Baltimore, now 12-8 under manager Buck Showalter. The defeat assured the Orioles (44-81) of a 13th consecutive non-winning season.
Hunter (10-2) gave up three runs and five hits over eight innings in a third attempt at his 10th win. The right-hander didn't get past the third inning in either of his last two starts and was 1-2 in his previous four outings.
Neftali Feliz allowed Wigginton's 20th homer in the ninth, then struck out the side for his 31st save.
Hamilton and Guerrero both connected off Kevin Millwood (2-14). Hamilton hit his 28th in the first to put Texas up 3-0 after the game's seventh pitch, and Guerrero made it 6-1 with a drive in the fifth.
Hamilton is 7 for 13 with two homers in his last three games following a 1-for-16 skid. He leads the AL with a .357 batting average.
Scott's team-leading 24th homer came on an 0-2 pitch from Hunter. He has six homers and 16 RBIs in 20 games this month.
Millwood gave up six runs, six hits and two walks in six innings. It was the 400th career start for the veteran right-hander, who is 0-6 in nine starts since June 24.
Millwood has allowed at least two first-inning runs in 12 of his last 16 starts. Of the 26 homers he's surrendered, 19 have come at Camden Yards.
It was the first time Millwood faced Texas since Aug. 17, 2005. The only major league teams he has never defeated are the Rangers, Minnesota and Atlanta.