Updated

Clint Barmes hit a solo homer and knocked in two runs as the Pittsburgh Pirates swept the Texas Rangers for the first time in franchise history with a 7-5 victory on Wednesday.

Justin Morneau went 4-for-5 with two runs scored for the Pirates, who remained within one-game of the St. Louis Cardinals for first place in the NL Central. Pedro Alvarez, Jose Tabata and Neil Walker each had an RBI.

Pittsburgh starter A.J. Burnett (8-10), who took a perfect game into the fifth inning, allowed five runs on six hits while striking out seven over 6 1/3 innings.

"The thing I'm most impressed with is our consistency, our focus and our preparation," Hurdle said. "It doesn't waver. We didn't come here with sweep on our mind. We came in here to win the first game."

Elvis Andrus went 2-for-5 with three RBI for the Rangers, who sit three games behind Oakland for the top spot in the AL West. David Murphy and Ian Kinsler added an RBI apiece.

Matt Garza (3-4) got the start for Texas and gave up three runs on five hits while striking out six and walking four over four innings.

"We'll be fine," second baseman Ian Kinsler said. "We've got an off day and then come back ready to play. It's all we can do."

The Pirates got on the board in the third inning. Felix Pie led off with a walk, stole second and raced home on Walker's single to center.

Pittsburgh tacked on two more runs in the fourth. Alvarez walked and Russell Martin and Garrett Jones singled to load the bases with no outs. Barmes followed with a walk to force in a run. After Pie struck out looking, Tabata plated a run when he grounded into a fielder's choice.

The Pirates scored a run off Joseph Ortiz in the fifth. Morneau and Marlon Byrd hit consecutive singles to put men on the corners with no outs before a run scored when Alvarez grounded into a double play.

Meanwhile, Burnett retired the first 13 batters he faced before giving up a one-out double to A.J. Pierzynski in the fifth.

Texas finally got on the board during its next at-bat. Murphy and Leonys Martin walked and Kinsler singled to load the bases with no outs. Andrus then hit a two-run single to shallow left field.

The Pirates scored a pair of runs in the seventh to make it a four-run game again. Neal Cotts came in from the bullpen with men on second and third and one out. Alvarez's sacrifice fly scored Morneau and Cotts' wild pitch plated Byrd for a 6-2 score.

The Rangers, though, made things interesting with a three-spot in the bottom half. Pierzynski led off with a double to center, advanced to third on Jurickson Profar's single and raced home on Murphy's single to right. Jeanmar Gomez took over on the mound and gave up RBI singles to Kinsler and Andrus. Bryan Morris recorded the final out of the inning to keep it a 6-5 contest.

Barmes' homer off Tanner Scheppers in the eighth gave Pittsburgh a two-run lead.

Kyle Farnsworth tossed a scoreless ninth, setting down the side in order to pick up his first save since 2011.

Game Notes

The Pirates recorded their eighth series sweep of the season ... Burnett improved to 5-3 lifetime versus the Rangers ... Pittsburgh went 15-5 versus the American League this season ... Texas went 10-10 versus the NL in 2013.