Video posted to Instagram on Tuesday shows a man berating and threatening to sexually assault officers in a Harlem police precinct.

The man walked into the 28th Precinct stationhouse on Monday and threatened a sergeant in the station house, a police source told The Post.

“Sergeant Lopez, he can suck a big fat f–king d–k,” the man said, according to the video. “Shut the f–k up, b—h,” he barked at the sergeant seconds later.

“I’m going to put it in your f–king a–,” the man added.

The sergeant and the man then got into an argument about whether he was allowed to record inside the precinct, with the belligerent man saying: “I can record; I can do what the f–k I want.”

The man walked out of the precinct and was not arrested for harassment, a police source said.

The incident happened less than a week after several people in a Bronx apartment building recorded themselves hurling obscenities at NYPD cops who were responding to a 911 call there.

“Suck my d–k! Suck my d–k!” a man recording that video shouted at cops as they walked downstairs in the building.