A 16-year-old suspected gang-banger virtually confessed to shooting two people over a coat at the Bryant Park skating rink as he ranted online about keeping the cops at bay and whether to kill himself, make the cops kill him or surrender Sunday.

“FEDS AT MY DOOR IM GOIN OUT WITH A BANG!!!!!!! TAKE MY SOUL,’’ Corey Dunton wrote on Facebook as police descended on his mom’s Bronx apartment, where he was hiding, around 8 a.m.

“LOVE ALL MY REAL N- - -AS ALL MY REAL SHORTYS FEDS TRIEN KICK DOWN MY DOOR ITS OVER WERE DO I GO FROM HEREEEEE MANNNNN DO I END MY LIFE IDK WAT TO DO I F- - KED UP,’’ Dunton wrote about an hour later.

“THESE N- - -AS GUNNA HAVE TO TAKE ME OUT TAKE MY LIFE THESE N- - -AS BEEN BANGIN FOR LIKE A F- -KIN HOUR I AINT GOIN TO JAIL I REATHER TAKE MY LIFE!!”

Shortly after, Dunton meekly surrendered. He was charged Sunday night with attempted murder, assault, criminal possession of a weapon and reckless endangerment.

Saturday night, Dunton had tried to mug Javier Contreras, 20, of Manhattan right on the Midtown rink’s ice, demanding the man’s Marmot Mammoth parka, known on the streets as a “Biggie,” sources said.

Dunton wrote on Facebook early Friday that he was going to the park fully loaded.

“Bryant Park Looking To Litt Saterday Gotta Bring Da. amp,” he wrote, using the slang word “amp” for gun, law-enforcement sources said.

His Facebook page showed him wearing red beads and holding his fingers in the shape of a pistol.

But Contreras refused to hand over his $680 yellow-and-green jacket, prompting Dunton to storm off the ice, sources said.

Dunton took off his skates and then went back to the rink’s railing and demanded Contreras’ jacket again, the source said. The pair didn’t know each other, sources said.

But Contreras still refused to give in. When he skated around again in front of Dunton, the suspect fired three shots with a .22-caliber handgun, hitting Contreras in the hand and hip, a source said.

Another skater, Adonis Mera, 14, of East Harlem also was struck — shot in the back and gravely wounded. A cellphone photo captured him tragically lying on the ice.

A law-enforcement source said Sunday that it appears Mera will be permanently paralyzed by the bullet.

He “has no feelings from the waist down,’’ Mera’s brother, Jorge Arias, 29, said early Sunday.

Another brother who visited Mera at Bellevue Hospital said: “I just wanted to see his face. He’s a baby. He’s a little kid.”

One neighbor called Mera “a great kid, not into violence or trouble.”

A tipster led cops to the Westchester Avenue apartment of Dunton’s mom.

Dunton was taken to the Midtown South precinct house, where he refused to answer questions and asked for a lawyer, a source said.

“He thinks he’s a gangster,” the source said. “He think’s he’s a real tough guy.”

Police sources said Dunton has a violent history, including arrests for robbery and grand larceny.

The bloodshed erupted at the park’s popular Winter Village attraction at around 11 p.m. Saturday, sparking the mayhem as skaters fled the gunfire.

Cellphone videos showed skaters hurtling over the rink wall and others searching for loved ones in the chaos.

Dunton had gone to the rink after a posting made the rounds on Facebook urging people to go to the free skating session, sources said. There appeared to be an especially large crowd from The Bronx there that night, sources said.

Dan Biederman, head of the Bryant Park Corp., which runs the park, called the shooting an “isolated incident” that marked the first violent crime there in more than two decades.

Biederman said 22 security personnel, including an NYPD cop, were working at the time. About five more cops were stationed there when the park reopened Sunday, drawing a normal-sized crowd.

“I don’t know if upping the security would have prevented this, so what we’re thinking of instead is should we make changes to hours or [the] admissions policy. But we’ve got to talk to the Police Department before we conclude anything like that,” he said.

Australian tourist Chris Dower, 63, said he heard about the shooting Saturday night but still went to the rink Sunday because “life has to go on.”

“It’s like a lot of things in life. If you’re at the wrong place at the wrong time, some bad things can happen,” he said.

Additional reporting by Joe Tacopino, Elizabeth Hagen, C.J. Sullivan, Daniel Prendergast and Reuven Fenton