ARLINGTON, Texas (AP) -- Pittsburgh reliever Mark Melancon allowed multiple runs for the first time in 65 appearances this season.
Still, he appeared to get a little extra on the pitch that ended the game, saving the Pirates' 5-4 victory over the slumping Texas Rangers on Tuesday night.
Melancon gave up four consecutive two-out singles, two of them producing runs, before striking out Adrian Beltre on three pitches with the potential tying run at third base.
''He got one of the best hitters in the game out to finish it off,'' Pirates manager Clint Hurdle said. ''Two outs, and nobody on base, and before you know it, you've got a game out there, you've got a nail-biter on your hands at the end. ... At the end of the day, he struck out the side, with a little action in between.''
Francisco Liriano pitched six innings for his career-high 16th victory and Andrew McCutchen had three RBI singles for the NL wild-card leaders.
A night after victory No. 82 ensured the Pirates' first winning season since 1992, they got a series-clinching victory and stayed within a game of NL Central-leading St. Louis.
''We're still hunting for more,'' said Jordy Mercer, who had two doubles among his four hits. ''We want to get more, as much as we can, that's for sure.''
Melancon struck out two pinch-hitters to start the ninth. Singles by Ian Kinsler and Alex Rios produced runs before Beltre, a .318 hitter already with two hits and an RBI, took the first pitch before swinging at the next two.
''I threw three heaters. Just getting ahead,'' Melancon said. ''The second pitch, he fouled back, and the third pitch I don't know if he was sitting breaking ball or not, but came back with another (fastball). ... I never really lost my composure or thought any negative thoughts.''
Even though it took 30 pitches to get his 13th save in 15 chances.
As for Beltre, Texas manager Ron Washington said, ''We know what his track record is and what he's capable of doing. He's a guy who always rises to a challenge. I'm looking forward to him coming back.''
Pittsburgh scored three runs with four consecutive two-out hits in the fifth off rookie left-hander Martin Perez (9-4), who had won his previous six starts since the beginning of August.
The Rangers, who still need another victory for their fifth consecutive winning season, will lose their fourth series in a row no matter what happens in Wednesday's finale. Texas has lost seven of its last nine games, but remained two games back in the AL West with Oakland's loss to Minnesota.
Liriano (16-7) struck out five while allowing one run to become the first Pirates left-hander since John Smiley and Zane Smith in 1991 to win more than 15 games. Liriano has received a decision in each of his 23 starts since signing as a free agent in February, the most for the Pirates since Larry French got a decision in each of his first 24 starts in 1930.
''Not his finest outing. A blue-collar effort,'' Hurdle said. ''I think a runner reached base every inning on in. ... All we did, we battled tonight, we battled off the mound, we battled at the plate.''
In the Pittsburgh fifth, Mercer doubled and scored on McCutchen's second hit. Marlon Byrd then singled before Gaby Sanchez had an RBI double. Byrd scored on a wild pitch.
The 22-year-old Perez is the only Texas rookie to win six consecutive starts, and it was the most for any Rangers pitcher since Kenny Rogers won eight in a row in 2005.
Texas got a run off Jason Grilli in the eighth, when Rios doubled with two outs and scored on a single by Beltre. Tony Watson took over and allowed a double to A.J. Pierzynski before striking out Jeff Baker to end the inning.
Pittsburgh went up 1-0 in the third when it appeared that Tony Sanchez stepped on the foot of catcher A.J. Pierzynski and never actually touched the plate. He came home on McCutchen's infield single.
Texas rookie Joey Butler drew a leadoff walk in the fifth and scored on Kinsler's double to center, a ball that went off the glove of McCutchen as he tried to make a sliding backhanded catch.
NOTES: The Pirates have 38 road wins, their most since that same amount in 1992. ... Texas also lost four consecutive series in June. ... The Rangers had been safe on 19 consecutive stolen base tries until Elvis Andrus was caught in the third inning. ... Kinsler's double snapped a 15-inning drought for the Rangers without a run or an extra-base hit. ... There was a disputed double play by Pittsburgh in the fourth. Pierzynski hit a grounder that 1B Gaby Sanchez backhanded while apparently sliding his foot across the base before throwing to second to get Beltre. Pierzynski argued with first base umpire Chad Fairchild before Washington and Beltre joined the discussion.