Charlie Morton finally got a couple of balls to bounce his way to break his personal losing streak and extend the Pirates’ winning streak to three games.

Morton pitched 5⅔ innings and allowed five hits and one earned run as the Pirates played both small ball and long ball to grab an early lead, then held on for a 4-3 win Friday night against the Washington Nationals before a crowd of 31,592 at PNC Park.

It wasn’t a thing of beauty and Morton (1-6) certainly wasn’t efficient. He walked four, hit a batter and threw 108 pitches (64 for strikes), but it was good enough for his first win in 15 starts dating to a victory Sept. 2 against the Milwaukee Brewers.

“I wasn’t great tonight but I was pretty good, good enough to get a win, and that’s all I care about,” Morton said. “I had a couple of tough outings but, for the most part, it wasn’t like I wasn’t pitching well.”

The other big development was that closer Jason Grilli was back on the mound after a stint on the disabled list (left oblique sprain). And, even though manager Clint Hurdle said before the game that Grilli would not appear in a save situation for at least a few games because “it wouldn’t be fair to [Grilli],” he did just that against the Nationals and notched his fifth save this season.

The plan was altered when the other two candidates to close — Justin Wilson and Bryan Morris — were needed in the seventh and eighth innings. Furthermore, Mark Melancon, who had been in the closer’s role while Grilli was on the mend, was not available after pitching three times in the past five games.

As a result, Hurdle said he was left with two available pitchers — Jeanmar Gomez, who is capable of pitching a lot of innings and would have been needed had the Nationals tied the score in the ninth, and Grilli.

“As the way the available arms played out, I only had one available arm after Jason,” Hurdle said. “And so he was going to have to give us an inning, so why not have him pitch the inning he is familiar with. It sounds funny, but that [ninth] has been his inning.

“Once he was in the game, it was familiar territory for him. He has some skill, but he has also has some moxie and some experience. He made his pitches when he had to and was aggressive.”

Grilli shook off an inning-opening walk to Anthony Rendon by striking out Jayson Werth and retiring Wilson Ramos and Ian Desmond on flyballs.

Desmond’s shot looked as if it could be trouble as it tailed away from right fielder Josh Harrison, but he made a leaping catch at the Clemente Wall to end the game.

“I think [Hurdle] just likes to throw you guys off sometimes,” Grilli said. “They told me today we had a couple of guys who needed some rest and they have been covering some great ground. We have a good bullpen. It felt great to be back, and there is nothing like getting into a one-run ballgame right out of the chute.

“It felt good, and I was like everyone else in the ballpark, hoping that last ball was coming down. But it went to the man right now [Harrison].”

The Pirates (21-26), who had seven hits and no errors, opened the scoring by scratching out two runs in the second after Ike Davis singled and Russell Martin doubled with no outs.

Starling Marte’s groundout to short drove in Davis and moved Martin to third, who scored on a wild pitch by Nationals starter Jordan Zimmerman.

The Pirates added two more runs in the bottom of the fourth when Pedro Alvarez followed Davis’ second hit with a two-run homer that sailed over the wall in center for a 4-0 lead.