The NYPD’s Hate Crime Task Force yesterday launched an investigation into Alec Baldwin’s tirade at a Post photographer.

Detectives brought the lensman and a Post reporter to a downtown station house, where they were interviewed at length about their racially charged run-in with Baldwin outside the actor’s East Village apartment building Sunday.

Photographer G.N. Miller, a retired NYPD detective, told cops that Baldwin called him a “coon,” a “crackhead” and a “drug dealer.”

Baldwin made other offensive comments, including telling reporter Tara Palmeri, “I want you to choke to death.” He also told Miller to “suck my d–k.”

Both comments were caught on Palmeri’s audiotape recorder.

The tape was sent to the NYPD’s forensic unit, police officials said.

The tape was also rolling when a rattled Miller returned to the reporter after being called racist slurs and recounted his shock over the incident.

“He said some foul s–t about my mom,” Miller said. “He kept calling me a name, coon.”

Miller told investigators he showed Baldwin his retired cop ID because he thought that the actor was being “too aggressive.”

Miller said Baldwin rejected the identification as fake, a dismissal Baldwin repeated to his Twitter followers with racially loaded language.

“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 also tweeted, “Ralston claims he’s ex NYPD!! That can’t be!!! Ex NYPD don’t become crackhead, ex jailhouse paparazzi!”

He removed the posts from his Twitter feed soon after.

It is unclear why Baldwin called the photographer “Ralston.”

Baldwin, 54, filed a complaint with police, alleging that Miller “pushed into him” during the incident.

Miller filed a counter-complaint, claiming harassment.

A source said that investigators are taking the allegations “very seriously” and that Baldwin could be charged with a hate crime if detectives find enough evidence of bias. The actor also was questioned by hate crimes detectives yesterday about the altercation.

Baldwin refused to comment to a swarm of reporters gathered outside his building.

Instead, the hot-tempered actor again used his favorite medium, Twitter, to proclaim his innocence — suggesting he couldn’t be a racist because his charity once made a donation to a children’s group named after the famed black tennis player Arthur Ashe.

“I find it ironic that my foundation’s last grant was $50,000 to the Arthur Ashe Learning Center,” Baldwin tweeted.

But critics said Baldwin has gone too far.

State Sen. Malcolm Smith (D-Queens) called on Hollywood to blacklist the tightly wound actor.

“If these allegations are true, then no television network or film studio should hire the veteran actor until he seeks help,” Smith said.

“In today’s modern age, it’s a disgrace that people still use remarks that provide hatred to others based on race, religion or origin.”

Noel Leader, co-founder of 100 Blacks in Law Enforcement Who Care, said Baldwin can’t simply use his donation to the Ashe foundation as a defense.

“One has nothing to do with the other,” he said.

“I can’t see why anyone would patronize or support his craft. As a black male, I’m offended by the word ‘coon,’ but the other things are just as offensive, these stereotypical descriptions of the photographer as a crackhead and drug dealer. It’s highly offensive.”

Noting Miller’s decorated career with the NYPD, Leader said: “That’s the irony of it all. Here’s a man who put his life on the line to make the city safe from the drug element and he’s being categorized as one, simply because he’s black.”

A spokesman for Baldwin, Matthew Hiltzik, said the actor had no comment on the hate-crimes investigation other than to repeat his denial that he made any racist remarks.

Baldwin’s pregnant wife, Hilaria, jumped to the actor’s defense.

“Shame on anyone who says my husband is racist,” she tweeted. “If you could only see/hear the dangerous things paparazzi will do & the lies to get a ‘story.’ ”

She praised her husband for going above and beyond the call of marital duty after he left home for a trip to a local market.

“Who is a better husband than @ABFalecbaldwin?” Hilaria tweeted. “He ventures outside our home to the streets littered w paparazzi & ‘reporters’ to get me melon.”

She blamed the paparazzi for forcing her to cancel her yoga classes.

“Dear @YogaVidaNYC,” she tweeted, using her yoga studio’s Twitter name, “due to the paparazzi situation, I will not be teaching classes this week. I’ll miss u & be back when these guys go away.”

It was a lawsuit filed against Hilaria’s studio that apparently got Baldwin all bent out of shape in the first place.

Additional reporting by Josh Saul, Lorena Mongelli and Jamie Schram