An embarrassed mobster ordered the brutal murder of an NYPD cop because the officer had the nerve to marry his ex-wife, prosecutors said at a former Colombo consigliere’s trial on Tuesday.

The pony-tailed Joel “Joe Waverly” Cacace’s is accused of orchestrating the 1997 shooting of Ralph Dols outside the Gravesend home he shared with Cacace’s ex-wife, Kim Kennaugh, and their infant child.

“Officer Dols was gunned down for one reason — he dared to marry the wife of a high ranking member of organized crime,”said prosecutor Sam Nitze during his opening statement at Brooklyn federal court.

Nitze painted Cacace, 72, as a ruthless force within the powerful crime clan whose orders were carried out without question.

“They knew that an order from Joel Cacace was an order they had to follow,” Nitze said of the men who carried out the kill.

“The defendant may not have pulled the trigger, but he is responsible because he ordered it.”

But Cacace’s attorney, Susan Kellman, said that there was no evidence that her client had anything to do with Dols’s murder — and that prosecutors were hitching their hopes solely on his association with La Cosa Nostra.

Kellman skewered the government’s main witnesses — the alleged killers — who flipped on Cacace and will testify against him.

Calling them “subhuman,” “maniacs,” and “animals,” Kellman characterized the men as soulless killers who are looking to save their own hide by lying about her client.

“It gives me chills to think about the type of crimes they’ve committed,” she told jurors.

Kellman added that Cacace and his wife had split cleanly and that he didn’t care that she took up with a new man — even a cop.

One of the men involved in the Dols killing, Joseph Competiello, testified Tuesday that he and his pals were ordered to do a “favor” for Cacace by Colombo brass.

Calabro admitted to his role in the crime but Saracino and Colombo hoodlum Tommy “Tommy Shots” Gioeli were acquitted last year.

Competiello made a deal with the feds on other killings and is awaiting sentencing.

Now dependent on a cane, Cacace is separately facing 10 more years in prison for his role in the botched 1987 hit on mafia prosecutor William Aronwald. The thugs killed their target’s elderly father by mistake.

One of the killers in the Aronwald case, Eddie Carnini, was married to Kennaugh at the time of that killing.

Cacace allegedly had Carnini killed because of the bungled slay — before shacking up with his widow.

Former Bonnano underboss Salvatore “Good Looking Sal” Vitale also made an appearance Tuesday to offer jurors a basic primer on mob activity.

Currently in a witness protection program for ratting out dozens of mobsters, Vitale’s main mafia rule was a simple one.