They came expecting a funeral.

A throng of purple-and-gold clad fans, 19,000 strong, shuffled into the StaplesCenter on Sunday night to properly eulogize the end of Kobe Bryant’s season, and perhaps the end of his team’s as well.

A funny thing happened on the way to the 2012-13 Los Angeles Lakers being laid to rest. It was the Spurs who showed up looking like the walking dead.

Behind a big game from Dwight Howard, Steve Blake’s “Black Mamba” impression and a 3-point barrage in the fourth quarter, the Lakers began life after Kobe-geddon by beating the lifeless Spurs 91-86.

“We didn’t match their energy at all,” Spurs coach Gregg Popovich said. “I just thought we floated through the game.”

Howard finished with 26 points and 17 rebounds, while Blake poured in 18 of his 23 in the first half to help guide the possibly season-saving win.

With it, the Lakers (44-37) remained in control for the final playoff seed in the Western Conference, a game and a half ahead of Utah. L.A. can clinch the bid with a win over Houston on Wednesday.

“We’ve done half the work,” L.A. coach Mike D’Antoni said.

For the Spurs, now 58-22 and clearly scuffling, the defeat all but mathematically seals them into the No. 2 seed behind Oklahoma City, eyeing a first-round series with either Houston or Golden State.

“All in all, just our focus wasn’t right,” forward Tim Duncan said. “Our energy wasn’t right. We didn’t play well for a long time.”

Playing for the first time since Bryant, 34, ruptured his left Achilles tendon Friday night against the Warriors, the Lakers were tasked with finishing their push for the No. 8 seed without the player most responsible for hauling them this far.

Popovich heard news of Bryant’s injury late Friday and didn’t want to believe it.

“It makes you sick to your stomach,” he said. “You play hard all year with the opportunity to get into the playoffs, and at the end of the year to have it snatched away from you — it’s unthinkable.”

For one night at least, the Lakers gave away nothing.

Tied at 61 entering the fourth quarter, the Lakers pushed the game open with five 3-pointers in 4 ½-minute span, three from Antawn Jamison and two from Jodie Meeks. That sparked a 19-9 run to put L.A. ahead by nine, and proved to be enough.

The Spurs got 23 points, 10 rebounds and three blocks from Duncan, who passed Charles Barkley for 22nd on the NBA’s all-time scoring chart.