Nationals teammates congratulate Bryce Harper after he hit his 13th homer of the season in Friday’s 10-0 rout of the Padres. (Gregory Bull/AP)

Only three weeks ago, the Washington Nationals’ offense ranked in the bottom third in the majors in runs. Denard Span and Jayson Werth were back from preseason surgeries, but their bats had yet to click. Since, the hits and runs have come in bursts — the latest evidence Friday’s 10-0 mashing of the San Diego Padres, the fifth time the Nationals’ lineup has produced a double-digit run output.

The Nationals started early with a four-run first, which was plenty offense for a pitching staff that delivered its third shutout. The win was the Nationals’ 13th in 17 games, and they moved to half a game behind the first-place New York Mets. In that span, the Nationals have averaged 6.5 runs. Friday’s output moved the Nationals into fourth in the majors with 4.86 runs per game — a feat accomplished without Anthony Rendon, their best hitter last year.

“Like I’ve been saying since the beginning, we were going to get going and everybody knew that,” right fielder Bryce Harper said. “We’re such a good team. We have so much fun out there. One through nine we’re such a good lineup. And our pitcher rakes.”

The Nationals feasted on Padres starter Odrisamer Despaigne and his inconsistent command. They jumped out to a 7-0 lead by the third inning. When starter Jordan Zimmermann smashed a double off the left field wall in the third, narrowly missing a home run by a few feet, every Nationals starter had a hit.

“We knew [the offense] wasn’t going to stay slow,” second baseman Danny Espinosa said. “There are too many good hitters on this team. . . . Guys are having good at-bats. Like people always say, hitting is contagious. We’re getting hits.”

The Nationals are finally improving on their below .500 start to the season. Post Sports Live debates whether the team is playing up to its potential. (Post Sports Live/The Washington Post)

Harper hit his 13th home run in the fourth inning, matching his 2014 total in only 37 games. Span, hitting .326, and Yunel Escobar, hitting .323, had two hits apiece. Four players — Harper, Espinosa, Ian Desmond and Ryan Zimmerman — each drove in two runs. Even Tyler Moore, who entered in the second inning when Werth exited after being hit by a pitch in the left wrist, notched a hit.

The Nationals’ first inning foretold what was to come. They loaded the bases with no outs on singles by Span, Escobar and Werth. Opponents have pitched carefully to Harper, which only extended the inning for the rest of the lineup.

“It provides us a bigger inning,” Manager Matt Williams said. “That’s what we want. It puts pressure on the opposing team when we’ve got guys all over the base paths.”

The Nationals’ offensive outburst — the most the franchise has ever scored in pitcher-friendly Petco Park — staked Zimmermann to a comfortable lead, and he delivered six scoreless innings. In 36 innings at this stadium, he has allowed only two earned runs. He struck out six Friday and walked only one. Zimmermann had the bases loaded with no outs in the fifth but escaped the jam with ease.

“I was able to throw inside with a purpose and that opened up the slider and the curveball,” he said.

With each start this season, Zimmermann has improved — he lowered his ERA to 3.66 on Friday.

“I was just a little out of whack mechanically and flying open,” he said. “The last couple starts have been a lot better and staying on the ball. The velocity is there now and the fastball command is right where I want it.”

Prospect A.J. Cole, called up Friday from Class AAA Syracuse to take injured Doug Fister’s spot on the roster, earned a three-inning save. He looked far more at ease than his major league debut on April 28, firing sinkers and change-ups low in the strike zone.

“I don’t feel like I had the nerves the first time up here,” Cole said. “I just had little mechanical issues and went down and fixed it there. I came back up and was ready to go. Everything looked a lot better this time.”

Despite the offensive fireworks and stout pitching, a cloud hung over the Nationals all night. Not only did they place Fister on the disabled list with right forearm soreness, Werth departed after getting hit by a 92 mph fastball by Despaigne on the left wrist. Werth has endured several wrist injuries, including a broken one in 2012 that required surgery and forced him to miss 75 games.

After the hit by pitch, Werth instantly fell to the ground and grabbed his wrist. The bulk of the force seemed to be taken by the wrist guard Werth wears. He took first base but kept flexing and grabbing his wrist. In between innings, he talked with Williams and left the game, replaced by Moore in left field. X-rays on Werth’s wrist after the game were negative and he will be evaluated again on Saturday, Williams said.

For now, the Nationals appeared to have dodged a major injury. But even without Werth much, the Nationals still managed to produce a torrent of hits and runs, signs of an offense in high gear.

“Everybody is having fun,” Harper said. “We’re playing hard. We’ve just gotta keep it going.”