SAN DIEGO — He’s back, and not a moment too soon. A series like this one deserved a superstar like Fernando Tatis Jr., after all.

The Padres activated their star shortstop from the injured list ahead of Friday’s highly anticipated season-series opener against the Dodgers, and he wasted no time providing the usual theatrics. In the bottom of the fifth inning, Tatis demolished a Walker Buehler fastball, sending it a Statcast-projected 410 feet to straightaway center field — a go-ahead homer to give the Padres a 2-1 lead.

San Diego wasn’t ahead for long, though. The Dodgers scored three runs in the top of the sixth, including a pair on a play on which Tatis committed a throwing error after making a diving stop.

Tatis had spent the minimum 10-day stint on the IL after sustaining a partially dislocated left shoulder on a swing 10 days ago. He’s always had a flair for the dramatic, and Friday night certainly presented the stage — the first game between the Padres and Dodgers this season after a winter’s worth of back and forth.

A raucous Petco Park, recently upgraded to 33-percent capacity, erupted on Tatis’ homer, as he emphatically pounded his chest while rounding first base, then executed his traditional skip around third.

“He’s a game-changing player, as I’m sure you all know,” Padres center fielder Trent Grisham said of Tatis before the game. “We’re excited to have him back. He’s very dynamic, and he’s very excited to get back. We’re pumped to have him in the lineup.”

The Padres optioned utility man Tucupita Marcano to clear space for Tatis on the roster. At the time, considering the gut-wrenching nature of the injury, it seemed unlikely that Tatis would be back in the lineup in such short order.

Tatis went through a series of tests in the day or two after the injury, which convinced him and the club that surgery wouldn’t be necessary. Doctors assured the Padres that Tatis couldn’t do any further damage to the shoulder by playing, after a short rest and recovery period.

Tatis, however, has dealt with a balky shoulder in the past, and there remains a risk of a further dislocation. If that were to happen again, the possibility for surgery would be back on the table, Padres general manager A.J. Preller said last week.

The Padres and Tatis are pressing on, optimistic it won’t recur, so long as Tatis goes through daily treatment and maintenance on the shoulder. The Padres aren’t asking Tatis to change his no-holds-barred playing style. But they might ask him to alter some mechanical aspects of his game — focusing on a two-hand follow-through on his swing and picking and choosing better times for his headfirst slides.

“How can we best minimize risk?” manager Jayce Tingler said. “Look, things are going to happen in the game. We’re just trying to do the best we can at talking about — what are some of the danger points or the high-risk levels? The last thing we want is, here in a couple days, a couple weeks, a couple months, something happening again.”

Prior to the injury, Tatis had played in only five games this season, and he struggled, going 3-for-18 while committing a startling five errors at shortstop. It’s unclear whether he was playing through injury at the time. It’s also unclear how Tatis’ shoulder woes might currently constrain him, if at all. Tatis, who signed a record-setting 14-year contract during the offseason, has not been made available by the club since before the start of the season.

Tatis’ return to the Padres’ lineup is a massive boost ahead of arguably the most highly anticipated regular-season series in Petco Park history.

The Padres got their most electrifying player back just in time for it.