Actor Alec Baldwin allegedly called a black Post photographer a racial epithet, a “crackhead” and a “drug dealer” during a confrontation on an East Village street yesterday morning, prompting police to intervene.

Baldwin had first been approached by a Post reporter while walking his dogs outside his East 10th Street pad at around 10:50 a.m. He was asked for comment on a lawsuit against his wife, Hilaria, involving her work as a yoga instructor.

The “30 Rock’’ star grabbed the reporter, Tara Palmeri, by her arm and told her, “I want you to choke to death,” Palmeri told police, for whom she played an audiotape of the conversation.

He then called G.N. Miller — a decorated retired detective with the NYPD’s Organized Crime Control Bureau and a staff photographer for The Post — a “coon, a drug dealer,’’ Miller’s police statement said.

At one point, Miller showed Baldwin ID to prove he’s a retired NYPD cop, which Baldwin dismissed as “fake.”

Cops were called, and Miller, 56, and Baldwin, 54, both filed harassment claims against each other.

Minutes later, Baldwin ranted on Twitter.

“Thank u 2 NYPD officers who came to my home 2day so that I could file a formal complaint against NY Post “photographer’’ who assaulted me,’’ he tweeted.

In another post, Baldwin referred to Miller, for unknown reasons, as “Ralston,” writing, “Moments after I tweet about the Post, Ralston, the ex-crackhead ‘photographer’ shows up at my door w 1 of Murdoch’s nieces in tow.”

He added, “Ralston claims he’s ex NYPD!! That can’t be!!! Ex NYPD don’t become crackhead, ex jailhouse paparazzi!”

The actor eventually removed most of the posts.

Miller also said the actor bumped him in the chest during their tete-a-tete, although Baldwin told cops the photographer “pushed into him,’’ according to the actor’s complaint.

Baldwin said he “asked [Miller] to keep his distance,’’ the complaint said.

But Miller said Baldwin was the one getting “too aggressive,’’ so he showed him his retired-cop ID.

Baldwin called the ID a “fake’’ and added Miller was a “crackhead” and a “drug dealer” who “just got out of jail,” Miller said.

Baldwin also made “disparaging remarks’’ about Miller’s mother, the photographer said.

As oblivious pedestrians walked by, Baldwin told him to “suck my d–k,” Miller said.

Baldwin also walked up to random people — including a dad pushing his child in a stroller — and told them Miller was an ex-con and drug dealer, Miller said.

“He was saying some serious racist stuff,” Miller said. “He said some choice words about my mother, and he was telling people in the street that I’m a drug dealer.

“He could have said a lot of other stuff. But he used all of the stereotypes associated with black people.”

Miller worked for the NYPD for nearly 15 years, spending most of his time in narcotics.

Although both men made police reports, it’s a case of he said-he said because the incident did not happen in the presence of a police officer.

Neither police complaint will go any further, except in possible civil action.

Baldwin’s spokesman, Matthew Hiltzik, called Miller’s accusations “completely false.’’

Baldwin, through Hiltzik, denied making the racist remarks, adding, “That’s one of the most outrageous things I’ve heard in my life.’’

But Baldwin has a history of making inappropriate comments to photographers.

Last June, the day before his wedding, Baldwin shouted to a black photographer on the street, “You gotta back up there Rodney.”

The photographer’s name wasn’t Rodney.