Bodycam video allegedly shows an LAPD officer planting drugs inside a black suspect’s wallet.

The footage was obtained by CBS-LA and posted online Thursday — marking the first time that an LAPD bodycam video has ever been made public.

The department has reportedly refused to release any clips pertaining to police investigations since the surveillance program began two years ago.

CBS managed to obtain a total of 12 videos, all worn by individual officers at the scene of a hit-and-run incident in April.

The suspect, Ronald Shields, 52, was arrested at the time and charged with felony hit-and-run and possession of cocaine. Officers claimed in the police report that they found a small bag of coke in the front left pocket of Shields’ shirt.

But bodycam video apparently tells a different story.

According to Shields’ defense attorney, Steve Levine, the footage allegedly shows an officer scooping the coke up off the ground — and not from his client’s pocket, like authorities claimed.

The cop then motions to another officer and appears to place the bag inside Shields’ wallet.

What he doesn’t know, at the time, is that his bodycam — which he has yet to turn on — is currently recording his every move.

The devices are designed to record 30 seconds prior to being turned on, but the officer appears to be unaware of this, seeing how he allegedly turns his camera on just moments after planting the coke inside Shields’ wallet.

“It seems improbable that someone would tape themselves planting drugs,” Levine told CBS. “So it seems more reasonable that when he turned on his cam he felt he was recording at that point.”

The cop — identified only as LAPD Officer Gaxiola — can be heard bragging about the bust and repeatedly telling fellow cops that he found “a bag of narco” in Shields’ wallet. But the story apparently changed when it came time for cops to go in front of a judge.

Another arresting officer, Samuel Lee, later testified in court that he actually found the coke in Shields’ pocket.

“He looked dumbstruck to me,” Levine said Thursday, describing Lee’s reaction to the bodycam video. “He had really no answer.”

Levine says the footage shows the exact moment when Gaxiola planted the drugs.

“There’s a little white square here, in his hand,” Levine said, pointing to it on video.

“It’s right there — a little white square,” he said. I believe the video shows that the drugs were originally in his right hand and he transfers them to his left hand. Now if you watch, he looks down to make sure they’re there. And that’s when the drugs were planted.”

Despite Levine’s argument, the judge in the case said Thursday that he did not see things the same way on the video.

Shields is scheduled to appear back in court in December. Levine says he will continue to challenge the evidence in the case.

The LAPD has had a notoriously bad relationship with the black community, with countless men and women coming forward with claims of police brutality and discrimination over the years.

The department announced Thursday that it would be conducting an internal investigation of the use of bodycams by officers in the field.