A knife-wielding homeless man went nuts outside ABC’s studios in Times Square on Tuesday and declared that he wanted to “kill Michael Strahan,” police sources told The Post.

Andre Johnson, 25, pulled the knife and made threatening remarks about Strahan, the New York Giants football legend and part-time co-host of “Good Morning America,” during an argument with a security guard near the show’s sidewalk-side set at around 8 a.m., according to the sources.

A police officer working security for the network quickly intervened and knocked the blade from Johnson’s hand.

Johnson was instantly detained by police and authorities recovered a serrated knife at the scene, a source said.

When the maniac was questioned, he said, “I was there to kill Michael Strahan,” according to police sources.

The former NFL star, who along with Kelly Ripa also hosts the popular talk show “Live with Kelly and Michael,” was not in any danger and he was not even aware of the incident until later in the afternoon, a studio source said.

An ABC News spokesperson said the suspect was “heroically tackled” by the cop and the incident was resolved immediately.

“It was a scary situation but thanks to the fast actions of NYPD the situation was quickly under control,” the spokesperson said.

Broadcast from Times Square, “Good Morning America” attracts a host of tourists, fans and onlookers trying to catch a glimpse of the star-studded action on Broadway.

The suspect was apprehended quickly enough that most of the surrounding audience was not even aware of the incident, a studio source said.

Strahan played defensive end for the Giants for 15 years, ending his career following Big Blue’s Super Bowl XLII victory over the Patriots in 2008. He will be enshrined in the Pro Football Hall of Fame next month.

Johnson was charged with attempted assault as a felony, menacing and criminal possession of a weapon. The suspect was awaiting arraignment in Manhattan Criminal Court on Tuesday night.

He has a number of out-of-state warrants and was likely to be held without bail, a clerk said.