Updated

Freddy Garcia gave up a pair of homers to Josh Hamilton, but pitched into the seventh inning and the New York Yankees held on for a 3-2 victory over the Texas Rangers.

Nick Swisher had an RBI double as part of a three-run third inning, as the AL East leaders won for the seventh time in eight contests. Eric Chavez went 3- for-3 with a run-scoring single.

Garcia (7-5) allowed four hits and fanned six over 6 2/3 innings to win his third consecutive start. He's undefeated over his last seven starts versus the Rangers.

Hamilton homered in the fourth and sixth innings, but was silenced in his at- bat leading off the ninth against Rafael Soriano by striking out.

"It's not really what you want in a one-run game with him coming up knowing what he's capable of doing and seeing some of the displays he's put on at Yankee Stadium," New York manager Joe Girardi said of Hamilton. "Soriano did a tremendous job on him."

Nelson Cruz reached first on Chavez's two-out throwing error, even though it looked as if Swisher was on the base when he scooped the ball out of the dirt. David Murphy grounded into a force play to seal Soriano's 29th save of the year.

The AL West-leading Rangers tied a franchise record with their eighth straight loss at Yankee Stadium, equaling the mark set in 1996. They'll try to avoid the four-game sweep Thursday.

Scott Feldman (6-8) yielded seven hits, walked four and struck out seven over six innings.

The start of the game was delayed 1 hour, 45 minutes due to rain.

Jayson Nix singled and stole second before making it to third on Derek Jeter's base hit to begin the third inning. Swisher then hit a bloop double to left field and Curtis Granderson made it 2-0 with a sacrifice fly to center field.

With two outs, Chavez singled to left field for a three-run cushion. Chavez has an RBI in five straight games and has driven in seven in that span.

"I just tried to keep the team in the game from there and we almost pulled it out at the end," Feldman said.

Hamilton belted a line-drive homer to the second deck in right field with one out in the fourth inning. The Rangers loaded the bases later in the frame, but Geovany Soto grounded into a 6-4-3 double play. Nix was upended at second base by David Murphy's takeout slide, and the throw to first nearly pulled Swisher off the base, but he stretched to hold on before tumbling to the ground.

In the sixth, Hamilton smacked a one-out shot to right for his 34th homer of the year. Hamilton continued his recent binge at the plate. In his last eight games, he has five homers and 11 RBI. The five-time All-Star upped his RBI total to 101 this season.

Game Notes

Yankees second baseman Robinson Cano missed the game due to a stiff neck ... Hamilton's 34 homers is a career-best, eclipsing the 32 he hit in 2008 and 2010 ... Rangers second baseman Ian Kinsler was ejected from the game in the eighth inning by home plate umpire Vic Carapazza for arguing a called third strike on the inside corner ... Rangers infielder Michael Young was given the night off.