They lost the series and their division lead but they left an impression.

The Cardinals halted a seven-game losing streak and kept Pittsburgh from making history at their expense Thursday night with a rollicking reassuring 13-0 victory at PNC Park. Starter Joe Kelly personified what the Cardinals described as a lively vibe in the clubhouse before the game and established a peppy dominant tempo that ended with the Cardinals shellacking Pittsburgh for more runs in a single night than they had in their losing streak total.

“It’s been gut-wrenching” Cardinals manager Mike Matheny said of the tumble the team took from the best record in baseball Monday to 2 1/2 games back of the Bucs on Thursday morning. “It’s something that you fall asleep thinking about and you wake up thinking about it and you wonder what that sick feelings is in your stomach when you get up. We haven’t been doing what we’re supposed to do what we’re paid to do.

“They realized we’ve got this opportunity to change that.”

Seven batters including Kelly had at least two hits as the Cardinals pasted the Pirates with 17. Tony Cruz who has replaced Yadier Molina as the starter in each of the two games he’s missed with a knee injury had three hits at the plate and guided Kelly and three relievers to a shutout with his work behind it.

The Cardinals now second in the National League Central after their 1-4 visit to Pittsburgh head to third-place Cincinnati for the final stop on this 11-game road trip. The distances traveled on the charter plane and in the standings was far shorter than the perception of how far the Cardinals’ quality of play had drifted. Matt Holliday said before the game that “five days ago we were the best team in baseball” and by Thursday morning the external feel was they were a mess. Matheny and players said that sense never penetrated the walls of the clubhouse.

The manager said there was “that awful music” playing in the clubhouse before the game. There was the usual playfulness in the dugout. Many of the vets wore their success after struggles in 2011 and 2012 on their sleeves not the losing streak.

“You almost have to relish the challenge of coming out of funks like this” said first baseman Allen Craig who had two hits and two RBIs.

The five-game series a rarity in the modern schedule became a baseball revival on the banks of the Allegheny River. It showed Pirates fans that yes this year’s first-place club isn’t going to fade as football season arrives. The four-day series drew 129623 fans a record total for a four-day series at PNC Park. Television ratings for several games set records. A day after Tuesday’s doubleheader sweep Pirates manager Clint Hurdle told reporters that he had received a standing ovation that morning at a local Starbucks.

He just went for coffee.

He got validation.

“I think we’re opening up a lot of eyes” Pirates lefty Jeff Locke said. “We’re not a joke.”

The Pirates started August in first place for the first time since 1992. They trailed by 1 1/2 games when the Cardinals arrived in Pittsburgh at the start of the week but had reversed the standings by the end. It took Thursday’s rout for the Cardinals to cut the deficit back to 1 1/2 games with nine games remaining this season against the Bucs. The emphatic win kept the Cardinals from being swept in a five-game series for the first time since 1916.

The Cardinals did Thursday what they couldn’t do Wednesday as the Pirates came back from three different two-run deficits to win. The Cardinals maintained the lead and added on early. Jon Jay took an extra base on Cruz’s single to be in position to score on a wild pitch. In the fourth inning Jay was hit by Charlie Morton’s pitch with the bases loaded to force in a second run. Jay would score on a two-out single by Pete Kozma for a 4-0 lead.