ANAHEIM, Calif. (AP) -- Joe Blanton thought he had this one in the bag, before the bottom dropped out on Ernesto Frieri.
The Los Angeles Angels' closer gave up three runs in the ninth inning and Pittsburgh scored four more in the 10th against Kevin Jepsen before Jason Grilli barely preserved the Pirates' 10-9 victory Sunday.
Blanton, who remained 1-10, departed with a 6-3 advantage. The frustrated right-hander allowed three runs -- one earned -- and six hits in 7 1-3 innings. The first run came on a homer by Pedro Alvarez, who connected for the fourth straight game.
Blanton is 0-12 in the last 18 games in which he's yielded a home run.
"Sometimes you have those years," said Blanton, who struck out six, walked none and retired his last 14 batters. "Baseball is a crazy game sometimes, and you've just got to keep executing out there and doing your work between starts and don't give up no matter what happens."
Frieri ended up with his second blown save in 19 attempts and first since April 29 at Oakland, when he gave up a tying single in the ninth to Yoenis Cespedes and the Angels ended up losing in 19 innings.
This time, Frieri issued a leadoff walk to Neil Walker -- ending his string of 22 consecutive batters retired -- then gave up a single to Gaby Sanchez and a one-out grounder by pinch-hitter Andrew McCutchen that scored Walker. Next came a pinch-hit RBI double by Russell Martin over the head of rookie left fielder J.B. Shuck, followed by Starling Marte's tying single.
"Ernie's been throwing the ball as well as anybody in the league," Jepsen said. "Anybody can have a rough game. When you're pitching in the back of the 'pen when the game is on the line, it's just more magnified. He was one strike away a couple of times, so it wasn't like he had no shot. Sometimes that's how close you come. But Ernie is very resilient and he'll be fine."
Alvarez led off the 10th against Jepsen (0-2) with a double to center field over Mike Trout's head -- seven innings after Trout had shifted over from left after an injury to Peter Bourjos.
A pair of one-out walks, one of them intentional to Walker, loaded the bases and brought up Travis Snider. He promptly lined a single to left that bounced over Shuck's head for an error and all the way to the fence as all three runners scored.
"When those guys get guys on base, they take advantage. That's why they're playing as well as they are," Jepsen said. "I guarantee you that going into the bottom of that inning, they were already packing up their stuff with a four-run lead. But we came back and got three. It stings right now, but with this many games, you don't dwell on it."
Martin drove in the final run -- and ultimately the decisive one -- with an RBI single in the 10th.
"I got to hang out in the air conditioning in here for about six innings, so I felt fresh when I got out there," Martin said with a grin. "But our guys battled back and had great ABs collectively, top to bottom, and it was fun to be a part of. We have no quit, that's for sure."
Grilli closed it out despite giving up five hits, including RBI singles by Alberto Callaspo, Shuck and Brendan Harris. The right-hander finally ended it by striking out Trout with the potential tying and winning runs in scoring position, completing the Pirates' first interleague sweep on the road.
"We pushed all the chips in and got what we needed to get from our guys -- and at the end of the day, the gunslinger got it done," Pirates manager Clint Hurdle said. "It was one of those games."
Pittsburgh starter Charlie Morton was charged with six runs -- three earned -- and four hits through 5 2-3 innings in his third start of the season. Mark Melancon (2-1) pitched a perfect ninth for the win.
Pirates catcher Tony Sanchez, the team's No. 1 draft pick in 2009, went 1 for 4 in his major league debut -- as the designated hitter. His first time up he hit a ground-rule double that struck the 18-foot wall in right field halfway up and became wedged at the bottom of the out-of-town scoreboard. The ball remained there until the end of the half-inning, when a maintenance worker climbed a ladder and plucked it out before giving it to Pirates right fielder Garrett Jones.