Fireworks were the perfect way to celebrate the beginning of Real Salt Lake’s rapid climb up the Western Conference Standings.

They lit up the sky over StubHub Center on July 4, following RSL’s 6-2 rout of the L.A. Galaxy.

Since that win at L.A., RSL has lost just two matches to move up six spots in the West and breathe life into its postseason hopes. After firing its head coach three games into the season and sinking to last place in the conference ahead of the L.A. match, Real Salt Lake’s season looked unsalvageable at the season’s halfway mark.

Yet somehow RSL and coach Mike Petke have righted the ship.

“I think [it was] just believing in us and sticking with his guns,” goalkeeper Nick Rimando said of Petke’s most important move as he took the head coaching job.

That wasn’t always the obvious route.

RSL endured some devastating losses early in Petke’s tenure. At the height of RSL’s struggle with a combination of injuries, international call-ups and suspensions, Real Salt Lake conceded a combined 11 goals in back-to-back blowouts at Houston and Dallas on May 31 and June 3.

But Petke saw even then what most people would only begin to glimpse a month later: the beginnings of a pretty good team.

“It was building, on a weekly basis in practice,” he said after a training session last week. “At times in the beginning it didn’t always show on the field, but we noticed it very soon after I took over. But it has taken off a bit over the last month and a half, two months.

“And again I’ve said it all along it’s a credit to the players. The message always was that ‘You guys have the talent, it’s just about putting that talent into play.’ And they did.”

(Leah Hogsten | The Salt Lake Tribune) Real Salt Lake head coach Mike Petke celebrates the win with Real Salt Lake forward Joao Plata (10). Real Salt Lake defeated the Colorado Rapids 4-1 for the Rocky Mountain Cup at Rio Tinto Stadium, Saturday, August 26, 2017.

Petke didn’t want to dump his entire philosophy on his players at once, but step by step he molded RSL into a balanced team, one that would only sit in if it had to, that was always looking for three points, and that relied on possession and combination play to score goals.

He implemented a practice schedule informed by the scouting report of RSL’s upcoming opponent and made sure his whole staff understood the reasoning behind everything they did.

“If somebody comes up to me, [assistant coach] Freddy [Juarez]or even [goalkeeping coach] Todd [Hoffard], asks them, ’Hey what’s the strength of LA? Todd knows it, Freddy knows it, we all know it,” said assistant coach Tyrone Marshall. “So we’re all on the same page. That’s what I think Mike has done in terms of changing the whole environment.”

The two-week Gold Cup break in July became an important time for growth. Because Petke was promoted from Real Monarchs coach to the first team on March 29, he didn’t have the luxury of mapping out his vision in the preseason. He described the international break as a mini-preseason camp.

RSL began the break with a focus on fitness, and played a 60-minute scrimmage in the middle of it. As the club neared league play again, tactical emphasis became the theme.

RSL was coming off a confidence-boosting blowout win in L.A., and Marshall and Juarez said they saw that match as the moment when the whole team bought into the system. The players carried that mentality into the break.

RSL’s late-season tear

Since being mired in last place in the Western Conference at the end of June, RSL has gone 7-2-3. The road back to contention:

July 4 • W 6-2 @ L.A. Galaxy

July 19 • W 4-1 @ Portland

July 22 • D 1-1 Sporting KC

July 29 • D 2-2 Columbus

Aug. 5 • D 0-0 Houston

Aug. 12 • W 1-0 @DC United

Aug. 19 • L 3-1 @ Montreal

Aug. 23 • W 4-0 San Jose

Aug. 26 • W 4-1 Colorado

Sept. 9 • L 3-2 @ Vancouver

Sept. 16 • W 2-1 Portland

Sept. 23 • W 2-0 Seattle

“That’s one of Mike’s biggest strengths is communication with the players, and the staff as well,” Juarez said.“That he asks for us to make sure we’re communicating with the players and giving info.”

Just last week, Petke and Marshall brought the players into a huddle to discuss how they would defend Seattle’s corner kicks.

The players offered up the pros and cons of different tactics, and the one they settled on kept Seattle from scoring on a corner in its two attempts.

“We didn’t see the Sounders be effective on something that they’re very effective on in most games,” Juarez said.

Tactics aside, Petke has a different management style than his predecessor, Jeff Cassar, who many described as one of the guys when he took the helm in 2014.

“The difference is Mike is basically in his second tenure as a head coach, whereas Jeff was in his first tenure,” Marshall said. “So I think Mike coming in kind of had a head start on Jeff. … Mike came in and he knew what he wanted to do. And he just went with it. Either you’re going to be on my team or we’re going to find someone else.”

When Petke first took over, the change in approach between the two coaches caused friction between Petke and a few of his players. Striker Yura Movsisyan’s tiffs with him over playing time played out on camera and in headlines in May and June.

As a whole, however, Petke gained the team’s respect, Rimando said.

And as RSL got healthier and Petke rolled out more of his plan, RSL began to win.

“Tactics aside, I think we needed to have a fire lit underneath us,” right back Tony Beltran said last week. “We needed belief back in the locker room, and Mike has given us that.”

The Saturday following Beltran’s comments, RSL beat Seattle 2-0 to climb to fifth in the Western Conference. Seattle was on a club record 13-match unbeaten streak and just a point behind the conference-leading Vancouver Whitecaps.

RSL at L.A. Galaxy

Saturday, 8:30 p.m. MDT