An FDNY firefighter has been charged with attempted murder in Rhode Island, with cops saying he stabbed two men nearly a dozen times — in their necks and torsoes — during a melee outside of a bar.

John Decarlo, 35, of Brooklyn, had gotten into an altercation with the victims inside of the All Stars Bar and Grill in Warwick, RI, early Wednesday around 1:15 a.m., which spilled out into the parking lot, according to local police.

Officers got a call about the ruckus and arrived to find the two men — identified by The Providence Journal as Matthew Theberge and David Ryan, both 25 and from Warwick — with multiple stab wounds. They were rushed to Rhode Island Hospital and listed as being in stable condition.

Four other men, who were identified by police, also allegedly took part in the mayhem and were charged with disorderly conduct.

Sources told The Post that the group was with Decarlo — an ex-Marine who was reportedly in town on military business as a member of the Army Reserve — at the All Stars bar when the initial dispute happened. They allegedly got into a shouting match with Theberge and Ryan, which led to the pair ordering all five men outside to fight.

“Come outside,” they told Decarlo and his buddies, according to police sources.

The group allegedly obliged, but refused to fight at first.

One of the other two men, either Theberge or Ryan, ran up on the SUV that the group was in and banged on the window as they were pulling out of the parking lot, sources said.

This prompted Decarlo and his pals to allegedly turn around and confront the pair.

Sources said they got out of the vehicle and attacked them, with Decarlo brandishing a pocketknife. He allegedly stabbed one of the men five times and the other four, leaving them both with serious injuries.

Decarlo was later arrested and charged with two counts of assault with intent to commit specified felony (murder) and possession of a knife longer than 3 inches, in addition to the disorderly conduct charge. It’s unclear how he was identified as the stabbing suspect. Cops simply said that they charged him “at the conclusion of the detectives’ investigation.”

Decarlo reportedly appeared in court Wednesday and was released on $50,000 surety bail. The smoke-eater is due back on Nov. 25.