Shooting a hit TV series about an anti-Mafia cop squad in Palermo, Sicily, can mean giving the Cosa Nostra a piece of the action, whether you know it or not.

In a somewhat surreal case of real life overlapping fiction, a recent investigation revealed that to make “Squadra Antimafia 3 Palermo Oggi,” the country’s top-rated TV series, prominent Italo production company Taodue had hired an alleged mafioso — apparently without knowing it — to handle casting of extras, and also for catering services and to scout locations in some of the city’s rougher quarters. Existence of a real connection between “Squadra Antimafia” and the Cosa Nostra emerged from a wiretap, published in newspaper Corwhich a mobster enthuses: “This TV series is great. We can give our friends work for at least five more years, because people really like it.”

The mob boss, in the published wiretap, stresses that it’s bad for business to try to extort money from the production. He adds that some “idiot” mafioso who did try to put the squeeze on Taodue “got the punishment he deserved.”

Meanwhile, the final episode of “Squadra Antimafia 3” — centered around an unlikely bond formed between a femme Mafia buster and her female Cosa Nostra counterpart — scored stellar ratings June 10 on Mediaset’s flagship Canale 5 station, with 6 million viewers, or about 26% audience share.The fourth season of “Squadra” is set to start shooting soon, with at least one change likely to be made on the crew.