NEW YORK — Rookie shortstop Elvis Andrus turned Melky Cabrera's liner into a game-ending double play, and the Texas Rangers held off the New York Yankees 10-9 on Tuesday night.

Michael Young and Nelson Cruz homered for the Rangers, who scored seven two-out runs off Joba Chamberlain to overcome an early four-run deficit.

They took a 10-5 lead into the ninth before New York started storming back against Texas' bullpen.

Jason Grilli allowed a leadoff single and a walk before he was relieved by closer Frank Francisco. Alex Rodriguez walked, Hideki Mastui lined an RBI single and slow-footed Jorge Posada knocked in a run with a rare infield single.

Robinson Cano's two-run single cut it to 10-9 and left runners at first and second with nobody out. But Nick Swisher popped up a foul bunt attempt for the first out and Cabrera hit a low liner to shortstop that Andrus caught on the fly.

Then, he beat pinch-runner Jerry Hairston Jr. in a close race back to second base to end it.

Josh Hamilton had four hits and Kevin Millwood rebounded from a rocky start, exemplifying the gritty pitching that has put the surprising Rangers in contention for their first postseason berth since 1999.

In a potential playoff preview against the AL East-leading Yankees, Texas took the opener of a three-game series and remained 1 games behind Boston in the wild-card race.

One day shy of his 21st birthday, Andrus drove in a career-best three runs from the No. 9 spot. Young, the AL player of the week last week, also had three RBIs.

Posada and Cano homered for the Yankees, who lost for only the fifth time in 21 games. They still own the best record in the majors at 78-47, but their division lead over the Red Sox was trimmed to six games.

Prized prospect Neftali Feliz replaced Millwood (10-8) in the sixth and shut down the powerful Yankees for two innings with a fastball that consistently registered in the high 90s (mph).

Coming off a 7-3 road trip, New York dropped to 41-19 at the new Yankee Stadium, still the best home mark in the big leagues.

Pitching on eight days' rest, Chamberlain (8-4) again failed to get deep in the game. Unable to put away hitters with two strikes or end innings with two outs, he threw 96 pitches in four innings.

The 23-year-old right-hander was dominant in his first three starts after the All-Star break, but then the Yankees began altering his schedule because they want to limit how many innings he throws this season.

He's having a hard time adjusting.

After going 3-0 in his first three outings after the break, Chamberlain is 1-2 in his last four with an 8.55 ERA (19 earned runs in 20 innings).

Millwood won for the second time in nine starts.

The Yankees put together a two-out rally to take a 4-0 lead in the first. Matsui, coming off a huge series in Boston, lined a two-run double. Posada followed with a two-run homer that barely cleared the short porch in right.

Chamberlain retired his first two batters in the second before Ivan Rodriguez singled and Davis walked. Andrus then grounded a two-run double that scooted past Alex Rodriguez down the third-base line.

Texas rallied again with two outs and nobody on in the fourth, this time scoring five runs by stringing five singles in a row — most of them not hit hard.

Cano's homer off the bottom of the left-field foul screen in the fourth was upheld by umpires after a brief video review. It was Cano's career-high 20th homer and it gave the Yankees six players with 20 home runs for the third time in team history (1961, 2004).

Cruz hit an opposite-field homer to right off Chad Gaudin in the fifth, making it 8-5. Young added a two-run shot to right-center in the seventh.

NOTES: Chamberlain is slated to start again Sunday against the Chicago White Sox. ... Ivan Rodriguez got his first stolen base of the season. ... Young extended his hitting streak to 12 games. ... Millwood has pitched 161 innings this season. If he reaches 180, the fifth year of his contract is guaranteed for about $12 million. ... Jeter hadn't walked in a career-long 113 plate appearances before drawing two free passes from Millwood. Jeter also singled and doubled off the right-hander.