HOUSTON — Pinch-hitter Hector Sanchez delivered a go-ahead single in the ninth inning and San Francisco rallied to beat Houston 3-2 on Tuesday.

HOUSTON — Pinch-hitter Hector Sanchez delivered a go-ahead single in the ninth inning and San Francisco rallied to beat Houston 3-2 on Tuesday.

The NL West leaders were down 2-1 entering the ninth. Brandon Belt singled off Wesley Wright to start the inning before pinch-hitter Joaquin Arias doubled off Wilton Lopez (5-3) to tie it. Sanchez completed the rally with his one-out liner to center.

Houston took the lead on a wild pitch by Matt Cain in the eighth. Cain allowed two runs and six hits in 71/3 innings.

Santiago Casilla (5-5) got two outs and Sergio Romo threw a perfect ninth for his seventh save.

The loss dropped Astros interim manager Tony DeFrancesco to 1-7 and came in front of 13,516 fans — the smallest crowd in the history of Houston's 12-year-old ballpark.

Pirates 9, Cardinals 0

At Pittsburgh, Pedro Alvarez homered twice and drove in four runs, James McDonald scattered two hits over seven innings and the Pittsburgh Pirates beat the St. Louis Cardinals.

Alvarez hit a two-run homer in the third to give the Pirates a comfortable lead, added an RBI double in the fourth and then hit a 469-foot drive to center in the sixth. He went 4 for 5 as Pittsburgh drew within two games of the Cardinals in the race for the NL's second wild-card spot.

Marlins 9, Nationals 0

At Miami, Stephen Strasburg gave up a career-high seven runs in five innings and first-place Washington's losing streak reached five games when the Nationals were beaten by Ricky Nolasco and last-place Miami.

Nolasco (10-12) allowed five hits in his third career shutout and eighth complete game.

Reds 5, Diamondbacks 2

At Phoenix, Johnny Cueto scattered four hits over seven innings for his major league-leading 17th win and Cincinnati beat the slumping Arizona Diamondbacks.

Cueto (17-4) gave up two runs, struck out one and walked five for his eighth victory in nine decisions. The right-hander lowered his NL-leading ERA to 2.48.

Braves 2, Padres 0

At San Diego, Kris Medlen extended his scoreless streak to 281/3 innings for Atlanta by holding San Diego to five singles over eight innings.

Medlen allowed only five baserunners and erased two of them on pickoffs at first base. He struck out nine to tie his career high and walked none.

Mets 9, Phillies 5, 10 innings

At Philadelphia, Ike Davis hit a tiebreaking double during a four-run 10th inning, Kelly Shoppach had a two-run homer and New York beat Philadelphia for its third straight victory.

Rockies 8, Dodgers 4

At Denver, Wilin Rosario homered among his three hits and drove in three runs, Tyler Chatwood pitched five effective innings and Colorado beat Los Angeles.

Andrew Brown had three hits for the Rockies, who have won eight of 10. Chatwood (4-3) allowed two earned runs and struck out four.

Brewers 4, Cubs 1

At Chicago, Jeff Bianchi hit a three-run shot for his first big league homer to lead the Brewers over Chicago.

Athletics 7, Indians 0

At Cleveland, Tommy Milone and three Oakland relievers extended Cleveland's scoreless streak to 22 innings.

Brandon Moss and Chris Carter homered off Zach McAllister (5-5) as Oakland won its fourth straight to remain tied with Baltimore atop the AL wild-card race. Oakland is 5-0 against Cleveland and has won 10 of 12 since dropping eight of 13.

Milone (11-9) worked six innings. Jerry Blevins, Pat Neshek and Evan Scribner completed Oakland's third straight shutout over the Indians.

Mariners 5, Twins 2

At Minneapolis, Dustin Ackley hit a three-run homer and Hisashi Iwakuma gave up one hit and one unearned run over six innings.

Iwakuma (5-3) struck out four and helped send the Twins to their 16th defeat in their last 19 games despite four walks, a hit batsman and a wild pitch.

The Mariners, who began the day nine games behind in the AL wild-card race, have won 12 of their last 16 games. They have won seven straight against the Twins.

Yankees 2, Blue Jays 1

At New York, Phil Hughes had another fine start at home, Nick Swisher extended his torrid streak with an RBI single and New York handed Ricky Romero his 11th straight loss with a victory over Toronto.

Hughes (13-11) won his sixth consecutive decision at Yankee Stadium, giving up only Adeiny Hechavarria's first major league homer in seven innings. He allowed four hits and walked three.

Orioles 6, White Sox 0

At Baltimore, Chris Tillman allowed one hit over seven innings and Nick Markakis drove in three runs as Baltimore defeated Chris Sale and Chicago for its fourth straight win.

Angels 6, Red Sox 5

At Anaheim, Calif., Los Angeles' Mike Trout and Torii Hunter drove in runs in the ninth inning against beleaguered Boston closer Alfredo Aceves.

Trout drove in the tying run with a one-out, broken-bat single, and Hunter ended it with a long sacrifice fly to center, scoring Alberto Callaspo.

Rangers 1, Rays 0

At Arlington, Texas, Yu Darvish struck out 10 over seven innings for Texas to win a pitchers' duel against Tampa Bay's James Shields.

Ian Kinsler homered to give Texas enough against the suddenly sliding Rays.

Royals 9, Tigers 8

At Kansas City, Mo., Mike Moustakas had three hits and three RBIs and Kansas City roughed up Justin Verlander.

Verlander, the reigning AL MVP and Cy Young Award winner, was charged with eight earned runs, matching his career high, in 52/3 innings.