Updated

The Oakland Athletics had an All-Star closer on the brink and were in prime position for another walk-off win.

They couldn't complete the rally.

Joe Nathan struck out Daric Barton with the bases loaded in the 10th inning and induced pinch-hitter Eric Sogard's first-pitch groundout to preserve the Texas Rangers' 6-5 victory Tuesday night, snapping Oakland's four-game winning streak in the rivalry and an unbeaten run of five in a row at home.

Chris Resop (1-1) allowed Adrian Beltre's tiebreaking home run in the 10th inning and then Mitch Moreland's second of the game. Nathan gave up a run in the bottom half but escaped a serious jam to get Texas back on track.

A's manager Bob Melvin was ejected by first base umpire D.J. Reyburn for arguing a close call on Barton's groundout that ended the eighth, the third time the reigning AL Manager of the Year has been tossed in 2013.

"I thought for sure from where I was that he was safe, and it wasn't the case," Melvin said. "I think it was very close but it looked like he was out and he got the call right. I deserved to be thrown out."

Beltre sent a 3-0 pitch from Resop to center field with one out in the 10th for his ninth homer of the year. Moreland connected two batters later, giving him three of his nine home runs in the past two games. He also hit a two-run shot in the fourth.

Resop pitched two scoreless innings in his most recent outing against Seattle but prior to that had been tagged for seven earned runs in 5 2-3 innings over a five-game stretch.

"I think it's worse than rough. I don't know, it's tough," he said. "I'm not going to sit here and lie. It's nothing fun. The team goes out there and busts their butts for 10 innings and we lost by one run. You hate to be the guy that let your team down. Feels terrible."

That easily could have been Nathan. He needed 31 pitches to nail down his 12th save in as many chances this season.

After a pair of one-out walks and a mound visit from pitching coach Mike Maddux, Seth Smith doubled in a run. Nathan intentionally walked Brandon Moss before striking out Barton on seven pitches. The closer then retired Sogard to end a game that took 3 hours, 43 minutes.

Tanner Scheppers (3-0) pitched two scoreless innings for the win. Nelson Cruz's second sacrifice fly of the game tied it in the eighth against Ryan Cook.

Josh Donaldson doubled twice among his career high-matching four hits for the A's. But there was no whipped cream-pie celebration Tuesday for a team that led the majors with 14 walk-off wins last year en route to a surprising AL West title.

"We played well. We definitely gave ourselves a chance to win it but just came up a little short," Donaldson said. "We always feel like we have the capability to win at any time, especially when it's late in the game and we're at home."

A's starter Bartolo Colon allowed three runs and four hits in six innings, but didn't strike out a batter in an outing of at least four innings for the first time in his 16 big league seasons. He issued just his second walk all year in 47 1-3 innings.

Yoenis Cespedes went 0 for 5 a night after he left before the fifth inning with a stomach bug that caused him to vomit twice in the dugout bathroom.

The AL West-leading Rangers (25-14) bounced back a night after having their four-game winning streak snapped in a 5-1 loss Monday to the 2012 division champions, who swept Texas in the final three regular-season games last fall to steal away the West crown.

The A's lost at home to the Rangers for the first time since July 17 last year. It marked Oakland's longest home unbeaten run in the rivalry since winning eight in a row from June 17, 2003, to April 6, 2004.

"They've had a good run against us here," Nathan said. "They're a tough ballclub and they know how to win games."

Nate Freiman hit a go-ahead double in the sixth after Luke Montz's tying sacrifice fly, but Cook couldn't hold a one-run lead in the eighth.

The A's loaded the bases with no outs in the fifth against Rangers starter Derek Holland, who allowed consecutive singles to Smith and Freiman and walked No. 9 hitter Michael Taylor. Holland then induced a double play that brought home Smith, followed by Jed Lowrie's RBI double.

Donaldson doubled leading off the sixth and Oakland tied the game at 3 on Montz's sacrifice fly. Smith then singled to chase Holland, who appeared on track for a third straight win until running into trouble in the fourth and fifth.

NOTES: Oakland INF Hiroyuki Nakajima, on the disabled list all season with a strained left hamstring, played for a third consecutive game in a rehab assignment with Triple-A Sacramento. He will have Wednesday off, then play four in a row. ... A's CF Coco Crisp is set to be activated from the disabled list Wednesday after working his way back from a strained left hamstring. Fellow OF Chris Young (strained left quadriceps) will be examined in Oakland, back from his rehab assignment with the River Cats. ... Taylor was optioned to Sacramento after the game to clear roster room for Crisp. ... Oakland pitchers have begun taking batting practice ahead of interleague play at San Francisco on May 29-30. ... On a night when the NBA's Golden State Warriors and NHL's San Jose Sharks both played second-round playoff games on the road, announced attendance was 12,969.