ARLINGTON, Texas — Jason Castro hit a tiebreaking three-run homer hours after being chosen for his first All-Star team, and the Houston Astros beat Yu Darvish and the Texas Rangers 9-5 on Saturday night.

The catcher's drive just to the right of the lawn in center field came off Robbie Ross in the seventh inning but made a loser of Darvish (8-4), who had a rough night after earning his second All-Star nod in two years in the majors.

The Astros built a 4-0 lead on a two-run homer by Brandon Barnes in the fourth and a two-run single from fellow rookie Marc Krauss an inning later.

Geovany Soto pulled the Rangers even in the sixth, following Mitch Moreland's sacrifice fly, with a three-run homer off Wesley Wright.

Travis Blackley (1-0) got the win with 1 1-3 innings of scoreless relief.

Darvish came out after walking Jose Altuve to start the seventh, and Brett Wallace was hit by a pitch from Ross. Castro, who had two hits and scored twice, followed with his 12th homer.

Wallace reached base all five times, adding two doubles and two walks.

Darvish, the major league strikeout leader, had six in six innings, but gave up six hits and a season-high five earned runs.

The Japanese right-hander, who came within an out of a perfect game in the second game of the season against the Astros, tied his season high with four walks. He has just one win in his past nine outings.

Houston lefty Dallas Keuchel took a shutout to the sixth but didn't get another out. He was replaced by right-hander Paul Clemens after singles by Elvis Andrus and Nelson Cruz, who was named an All-Star reserve. Cruz had three hits, including his 22nd homer.

Clemens got Adrian Beltre on a popout but walked Lance Berkman to load the bases. After Moreland ended the shutout, Soto hit his tying shot into the Houston bullpen in left-center field.

Krauss was 1-for-15 in his career before getting three straight singles. The first two — including his first run-scoring hit on a bases-loaded single — were off Darvish.

Jake Elmore had his first career homer for Houston, a two-run shot in the eighth.

Rangers prospect Jurickson Profar made his first pro start in left field as manager Ron Washington tries to figure out ways to get him in the lineup. Profar had a diving catch, while fighting the sun, to save a run and end the second inning.

NOTES: Rangers RHP Joakim Soria could be activated Sunday. He is coming back from elbow reconstruction surgery and hasn't pitched in the majors since Sept. 11, 2011, with Kansas City. ... Rangers RHP Alexi Ogando gave up four hits and three runs in two innings in a rehab assignment with Triple-A Round Rock on Saturday night. He will make another start for Round Rock on Thursday. ... RHP Mark Appel, the No. 1 overall pick by the Astros, allowed three hits and two runs (one earned) in his professional debut for Class A Tri-City on Friday. ... The Rangers had a 30-minute pregame ceremony to honor first-responders and residents of West, Texas, where 15 people died in an explosion at a fertilizer plant in April.