KOBE Bryant slam-dunked Spike Lee right before the taping of “Kobe: Doin’ Work” by demanding creative control over the documentary and forcing the director to drive to his house to beg for a meeting to save the project, sources told Page Six.

Lee had worked for months to get permission from Bryant, the Lakers team, coach Phil Jackson, the NBA and ESPN, which will air the day-in-the-life documentary on May 16. The director had already flown to Los Angeles, where 30 cameras were in place for the April 13, 2008, Lakers game against the San Antonio Spurs.

But suddenly Bryant said he wouldn’t cooperate unless he was granted creative control, sources said. Lee tried several times to call Bryant, who wouldn’t accept his calls. So Lee, at the suggestion of ESPN broadcaster Stephen A. Smith, drove to Bryant’s house in a gated community, where Bryant refused to see him, sources said.

“It went so far that Lee had a last-minute plan to substitute Spurs star Tim Duncan for Kobe and make the whole documentary about Duncan,” said our source.

But Kobe and Spike somehow worked it out, and Lee is being a good soldier promoting the Kobe picture, which screened Saturday night at the Tribeca Film Festival.

“Spike Lee completely yielded,” said one insider. “And at the start of the film, when Kobe arrives at the Staples Center and sees Spike with the camera, he gives him a big smile and thumbs up, showing he knows he won the battle.”

A spokesman for Lee claimed he retained creative control and called the story of the dispute “completely baseless.” But Bryant — who’s known to be a control freak when it comes to his public image — couldn’t come off better in Lee’s flattering homage.