SAN DIEGO (AP) — Baseball fans in San Diego have been waiting a long time to party like this and the Padres were more than happy to finally oblige.

What made it so much sweeter was that they toppled the mighty Los Angeles Dodgers, the best team in the majors this year and one that had beaten up on the Padres regularly for the better part of two seasons.

Jake Cronenworth hit a tiebreaking, two-run single with two outs in the seventh inning and San Diego rallied past the Dodgers 5-3 Saturday night to advance to the NL Championship Series for the first time since 1998.

Petco Park shook and the sellout crowd of 45,139 roared when Josh Hader struck out Mookie Betts, Trea Turner and Freddie Freeman in succession to end the Padres’ third straight win against the Dodgers.

Hader and third baseman Manny Machado jumped into each other’s arms and the rest of the team joined them in a wild celebration on the infield grass as fireworks went off above the downtown ballpark. Machado and Juan Soto exhorted the fans for more as they all reveled in the middle of a rare San Diego rainstorm.

“Our fans have been waiting for so long and I used to be that fan that was waiting,” said Joe Musgrove, the hometown kid who started the clincher. “It feels good to be on this side of the ball, I’ll tell you that, but these fans deserve to celebrate tonight.

“I know the job’s not done, we’ve got a lot of baseball ahead of us still, but this is something that needs to be celebrated,” Musgrove said. “Those guys handed it to us all year long and when it came down to it and we needed to win ballgames we found ways to do it.”

Before a sign-carrying crowd chanting “Beat LA! Beat LA!,” the Padres stunned the 111-win Dodgers with a five-run seventh to win their best-of-five NL Division Series 3-1.

“It’s about to be a party out here tonight,” said Musgrove, who grew up a Padres fan in the San Diego suburbs.

“I mean, since I was a little kid we’ve been getting beat up by the Dodgers. But when it comes down to it and the games matter, this team stepped up, from top to bottom.”

The Padres had lost nine straight series to the Dodgers before winning the one that mattered the most.

San Diego will host the Philadelphia Phillies in Games 1 and 2 of an all-wild card NLCS on Tuesday and Wednesday. The Phillies beat the defending World Series champion Atlanta Braves 8-3 earlier in the day to win their NLDS in four games.

“This is what the city’s been waiting for for a long time,” said Machado, the Padres’ $300 million third baseman and unquestioned leader.

The Padres last reached the NLCS 24 years ago when they beat Atlanta in six games and were then swept by the New York Yankees in the World Series. A handful of players from that team watched from a luxury suite, including Hall of Fame closer Trevor Hoffman and center fielder Steve Finley.

It was a soul-crushing ending for the Dodgers after the best regular-season record in club history and manager Dave Roberts’ prediction during spring training that they’d win the World Series.

“Shock factor, very high. Disappointment, very high. It’s crushing,” Roberts said. “Each guy gave everything they had all year long, and a tremendous season. The great thing about baseball is the unpredictability, and the tough thing about it is the same thing.

“Nothing I can say is going to make it feel any better. Obviously we didn’t expect to be in this position,” he added.

The game was delayed 31 minutes at the start by showers, which returned in the eighth inning and prompted a short delay while the grounds crew worked on the mound.

After left-hander Tyler Anderson stymied the Padres through five scoreless innings, San Diego broke through against the Dodgers’ bullpen in the seventh.

Jurickson Profar drew a leadoff walk against Tommy Kahnle, took third on Trent Grisham’s single and scored when Austin Nola’s infield single glanced off Freeman’s glove at first base. Yency Almonte, who took the loss, came on and was greeted by Kim Ha-seong’s RBI double inside the third base line, followed by Soto’s tying single to right.

With two outs and the crowd on its feet, Cronenworth singled to center off local product Alex Vesia to give the Padres the lead, raising his arms in celebration as he rounded first and then punching the air with his right fist as he pulled into second base on the throw home. Soto, acquired from Washington in a blockbuster trade Aug. 2, slid home headfirst and jumped up and cheered.

“We talked about it all day — we’re winning tonight no matter what the situation is,” Cronenworth said.

“It took a team effort to beat a really good team and we did that,” Machado said.

After the first rain delay, fans were amped up in anticipation of Musgrove pitching his hometown Padres into the NL Championship Series. The big right-hander from suburban El Cajon, a first-time All-Star in 2022, was the first Padres pitcher from San Diego to make a postseason start in his hometown.

But Anderson outpitched Musgrove, holding the Padres to two hits through five innings.

The Dodgers took a 2-0 lead in the third. Betts walked with one out and Turner scorched a grounder past third baseman Machado, who has carried the Padres much of the season, to move Betts to third. Freeman, who helped the Braves win the World Series last year before signing with the Dodgers as a free agent, doubled down the right field line to bring them both in.

Will Smith hit a sacrifice fly against Steven Wilson with the bases loaded in the seventh for a 3-0 lead, but winning pitcher Tim Hill prevented further damage.

The Dodgers will be left with an empty feeling. They won the NL West for the ninth time in 10 seasons and finished 22 games ahead of San Diego. The Dodgers went 14-5 against the Padres in the regular season.

Musgrove was trying for his second straight playoff series-clinching win. On Sunday night, he dominated the New York Mets at Citi Field, allowing just one hit and one walk in seven innings in a 6-0 win that sent the Padres to the NLDS.

He gave up two runs and six hits in six innings against the Dodgers, struck out eight and walked three.

FIRST PITCH

Jake Peavy, the 2007 NL Cy Young Award winner who was Musgrove’s boyhood idol, threw out the ceremonial first pitch to former teammate Mark Loretta. Musgrove switched to Peavy’s No. 44 after he was obtained by the Padres prior to the 2021 season.

UP NEXT

Dodgers: Play their spring training opener Feb. 25 against Milwaukee.

Padres: RHP Yu Darvish likely will get the start Tuesday in Game 1 of the NLCS.

___

More AP MLB: https://apnews.com/hub/MLB and https://twitter.com/AP_Sports