The Mafia didn’t kill Gambino boss Francesco “Franky Boy” Cali — but a Staten Island knucklehead with a personal beef over a woman did, police and other sources said Saturday.

Anthony Comello, 24, who lives with his parents and works odd construction jobs, was in custody in New Jersey and expected to face murder charges in connection to the Wednesday shooting of Cali, 53, police said.

The don was blasted at least 10 times outside his mansion in Staten Island’s Todt Hill neighborhood, prompting initial speculation of a Gambino power struggle.

The real motive? Sources now believe Cali didn’t like Comello hanging around a particular woman in the mob boss’ family — and the younger man, who is not a mobster, was so outraged by this slight that he slaughtered one of the most dangerous Mafiosi in the country to get revenge.

Cali’s niece was at the don’s mansion at the time of the hit, the sources told The Post — and may have been the subject of the dispute.

Comello was safely in handcuffs before the ire of the entire Gambino organization could thunder his way, but only thanks to his own alleged ineptitude.

In a fleeting gesture that Comello may now have a lifetime in prison to regret, he had picked up and handed to Cali a fallen license plate right before allegedly opening fire.

In that moment, he may have handed the murder’s most incriminating evidence to his own alleged victim, who tossed it into his car.

Crime-scene investigators dusted the license plate, ran the prints recovered from it and got a hit for Comello, whose prints are on file from his application for a rifle permit, the sources said.

Realizing it no longer had a potential well-orchestrated mob assassination on its hands, the FBI has scaled back its role in the case, leaving the NYPD in control, the sources said.

“This went from the perfect crime to amateur hour,” one law-enforcement source quipped.

Another source noted the idiocy of Comello allegedly handing Cali the number one clue to the murder.

“Anthony Comello will go down in the record books as being one of the dumbest killers in New York City history, if not in the US and the world,” that source said.

“Not to mention that the victim was the head of the Gambino crime family.”

Comello confessed to the slaying under early questioning by cops, then lawyered up and shut his mouth, the sources said.

At a Saturday-afternoon press conference, NYPD Chief of Detectives Dermot Shea confirmed that Comello had been arrested in the Jersey Shore town of Brick in Ocean County.

He was being held in the county jail pending extradition to New York.

“I think it bears repeating — we are not yet three days into this incident,” Shea said.

“While we believe we have the shooter in custody for this incident, the investigation at this point is far from over.”

Shea also confirmed that prints were recovered as evidence from Cali’s Cadillac Escalade SUV.

“So what I will say is the victim’s car that was present at the murder scene that night — we believe we have fingerprints recovered from that car,” he said.

Cali’s murder was the first assassination of a New York City Mafia don since an upstart John Gotti had Gambino boss Paul Castellano whacked outside Sparks Steak House in Midtown in 1985.

After initially fearing a mob war, investigators are now focusing on the Cali-Comello connection.

The two men lived in large, well-landscaped brick homes just a 20-minute drive apart: Cali in Todt Hill and Comello in Eltingville.

But the nature of the dispute, and how the two knew each other in the first place, was unclear.

Cali’s family is being less than forthcoming, and Comello’s family simply doesn’t know, the sources said.

But investigators do believe that Cali — who helmed a family notorious for gambling, loan-sharking and a deadly trade in heroin and oxycodone — had come to think that Comello was no good.

Despite his own reputation and Comello’s clean rap sheet, Cali didn’t think the kid was worthy of associating with his family, the sources said.

“[Comello] is always nice when I see him, says ‘Hi’ to me,” said Staten Island neighbor Victor Ujuck.

“One time he helped fix my car. He plows the snow out for us, too. I know he likes fireworks. Sometimes at around midnight, he shoots off fireworks, and I have to tell him my kid is sleeping. That’s really it.”

Comello’s Facebook page says he attended Tottenville HS in Staten Island.

He is listed as single on his account bio.

A 2016 photo shows him carrying a little boy at an apple orchard as a little girl looks on. He has also posted several pictures of his dog, a blue-nose pit bull named Smokey.

According to the sources, Comello was arrested at around 2 a.m. Saturday by the US Marshals’ New York/New Jersey Regional Fugitive Task Force. Comello was sleeping at the time in his family’s shore home.

He was unarmed and did not resist arrest, the sources said.

In the driveway was Comello’s gray GMC Sierra — with a small dent on the left side of the rear bumper.

An NYPD tow truck hauled the pickup from the house Saturday evening.

Probers believe Comello used the truck to lure Cali from his mansion, by ramming it into the mob boss’ Escalade, parked outside, just before 9:20 p.m. Wednesday.

After the loud crash knocked the license plate off the Escalade, Cali rushed outside; surveillance footage shows the two men spoke and shook hands, the sources said.

At some point, Comello picked up the fallen license plate from the street and handed it to Cali, who tossed it in the back of his SUV, the sources said.

Also Saturday, John Gotti Jr. took a whack at law enforcement for originally believing his recently sprung uncle, Gene Gotti, may have been involved in the rubout.

“I wonder if these tremendously insightful law-enforcement individuals are going to issue an apology,” Junior, 55, told The Post.

Told of Junior’s remarks, one law enforcement source said, “Tell Junior we will apologize once his family apologizes to the Castellano, Lino and Johnson families, and all the other families whose relatives they killed and got away with.”

Additional reporting by Amanda Woods and Nick Fugallo