A man has been arrested for breaking the window of a New York apartment where two Confederate flags had been hanging.

Darren Keen, a 34-year-old DJ, had bragged on Instagram that he had punched the sixth-floor window of the East Village apartment on Friday night.

He was arrested about 30 minutes later and charged with criminal mischief.

Keen, who lives around the corner from the apartment on East 8th Street, had climbed up the fire escape before covering his hand with a shirt and punching the window.

Darren Keen, a 34-year-old DJ, was arrested Friday night after punching the sixth-floor window of an East Village apartment after spotting the Confederate flag

The two Confederate flags along with an American flag and Israeli flags had hung in the windows of the top floor apartment for several months but drew further anger in the aftermath of the deadly protests by white nationalists in Charlottesville, Virginia.

Residents of the neighborhood had gathered outside the apartment block earlier in the week shouting insults and throwing rocks at the window.

A tarp was draped from the roof of the building on Friday to try and conceal the flags.

Keen, who is originally from Nebraska, told DNAinfo that his wife had spotted the flag about a month ago but he became enraged when he saw how angry his fellow residents were getting.

'It's one thing for me, a white Nebraskan, to be annoyed by redneck culture... to actually see the anger and frustration it was causing disadvantaged people in the neighborhood, it escalated my feelings a lot,' he said.

In the aftermath of the window breaking, Keen posted several photos on Instagram of his bleeding hand.

Residents of the neighborhood had gathered outside the apartment block earlier in the week shouting insults and throwing rocks at the window after noticing the Confederate flag

Keen had bragged on Instagram that he had punched the sixth-floor window by posting photos of his bloodied hands before he was arrested

Keen, who is originally from Nebraska, said his wife had spotted the flag (above) about a month ago but he became upset when he saw how angry his fellow residents were getting this week

'Yo I punched this nazi dudes Windows out in front of racist nypd I can't take it any more. Now they knocking on door when they come to mine I'm gonna blow a massive weed rip in their face and say lets all calm down as they beat and subdue me to keep a white supremacist safe,' he wrote.

He later shared a photo of himself being arrested saying he had wanted to draw a Wutang logo on the tarp but opted to punch the window when he couldn't find any paint.

Keen showed off his cut hand in a photo posted on Instagram on Saturday. He bragged about his charge, saying: 'I just got a ticket for "mischief" which is lower than vandalism

'Yeah ok I was dumb for punching out the window instead of painting the wutang logo but I did scream "f**k white supremacy wutang is for the children" while getting put into the car,' he wrote.

When the tarp was taken down on Saturday, the Confederate flag had been removed.

Keen later claimed that police had removed the flags from the man's window, but the NYPD denied this saying it was freedom of speech.

He also bragged about his charge, saying: 'I just got a ticket for "mischief" which is lower than vandalism. S**t worked out real good IMO.'

NYPD continue to be stationed outside the apartment.