Joan Allen, Dustin Hoffman, John Ortiz and Dennis Farina appeared in the racetrack drama. (Gusmano Cesaretti /HBO)

HBO has canceled its racetrack drama “Luck” after a third horse died during production of the show.

“It is with heartbreak that executive producers David Milch and Michael Mann together with HBO have decided to cease all future production on the series ‘Luck,’ ” the premium cable network said in a statement late Wednesday.

Earlier in the week, People for the Ethical Treatment of Animals asked the Los Angeles County District Attorney’s Office and the Pasadena Humane Society to investigate the deaths of horses in the production of the HBO series.

Filming of scenes that involve the use of horses had been shut down indefinitely after the third horse died Tuesday. The horse was euthanized after rearing, falling backward and hitting its head on the ground while being led back to its stall at Santa Anita Racetrack. The horse had just been examined to make sure it was fit to appear in a scene for the second season of the drama series, which starred Dustin Hoffman as a crime kingpin trying to take control of a racetrack.

“While we maintained the highest safety standards possible, accidents unfortunately happen and it is impossible to guarantee they won’t in the future,” HBO said in its statement. “Accordingly, we have reached this difficult decision.”

“We are immensely proud of this series, the writing, the acting, the filmmaking, the celebration of the culture of horses, and everyone involved in its creation,” the network said.

Mann and Milch also issued a statement with word of the cancellation: “The two of us loved this series, loved the cast, crew and writers. This has been a tremendous collaboration and one that we plan to continue in the future.”

The American Humane Association has been overseeing the program since it began production. The association’s Los Angeles-based Film & TV Unit is the film and television industry’s only officially sanctioned animal-monitoring program. It’s the organization that gives movies and TV series episodes that “No Animals Were Harmed” disclaimer you see at the end of programming.

PETA says the three dead horses were victims of “sloppy oversight.”

In its statement, the AHA pointed out that the most recent death did not occur on set, while filming or during racing, but rather while the horse was being walked back to its barn by a groom. And yet, AHA boasted: “We immediately demanded that all production involving horses shut down. We are also insisting that this stoppage remain in full effect pending a complete, thorough and comprehensive investigation.”

In its complaint to Los Angeles law enforcement, PETA noted that the previous two “Luck” horses died — one in 2010, the other in 2011 — after breaking their legs during or immediately after running a second “race” in a day. Karen Rosa, senior vice president of the AHA’s Film & TV Unit, told the TV Column that the “races” are short — no more than a quarter-mile each.

PETA says that’s still too taxing physically and mentally on retired racehorses, which “wouldn’t understand that when they went through the starting gate on a racetrack, it was just for a TV show and not a real race.”

Neither of the first two horses that died during “Luck’s” production “should have been anywhere near a racetrack,” Kathy Guillermo, vice president of PETA, told the TV Column. The organization had claimed that one of the horses was so arthritic that it hadn’t raced in years, and that the other horse was “so sore, he was given a potent cocktail of muscle relaxant and anti-inflammatory and painkilling drugs, including Butorphanol, a painkiller so strong that it’s often used as an analgesic for horses undergoing some kinds of surgery.”

“Butorphanol is so powerful, they can castrate a horse on that drug,” Guillermo told the TV Column.

Rosa told the TV Column she didn’t know where PETA could have got that information.

Guillermo, who’s based in Northern California, handles issues having to do with racehorses for PETA. She told the TV Column that PETA got its information from the necropsy report and from “caring whistleblowers” concerned about the horses being used to shoot the series.

Rosa noted that new, stricter protocols, including blood testing for drugs, were put into place after the death of the first two horses.

HBO had responded to PETA’s claims, saying, “Recent assertions of lax attitudes or negligence could not be further from the truth.” The network noted in a statement, issued after the third death, that its safety protocols for the “Luck” horses had gone “above and beyond typical film and TV industry standards and practices.”

“For example, pre-race exams are performed by a California Horse Racing Board certified veterinarian, and radiographs are taken of the legs of all horses being considered for use in any simulated racing sequences,” HBO said before the show’s cancellation.

HBO’s statement included a comment from California Horse Racing Board equine medical director Rick Arthur, who said of this week’s death: “Unfortunately, we see several of these injuries in the stable area every year. They are more common than people realize.”

AHA’s “No Animals Were Harmed” disclaimer did not appear at the end of two episodes of “Luck” in its first season, Rosa told the TV Column.

In those two episodes, the language was modified, she said, and “indicated we monitored the animals. We did not say no animals were harmed.”

Jones’s ‘Idol’ exit

Producers attempting to liven up the aging “American Idol” by retrieving Jermaine Jones — who’d been weeded out by judges — got more than they bargained for when they learned he’d had run-ins with the law using various fake names.

“Awww I will no longer b on the show,” Jones tweeted Tuesday on his official “Idol” Twitter account, after the Web site the Smoking Gun posted documents indicating that he had outstanding arrest warrants in New Jersey. His entire “Idol” Twitter account has been deleted.

“Idol” exec producer Nigel Lythgoe told TMZ on Wednesday afternoon that Jones would be seen being given the heave-ho on this week’s performance show.

The fake names ultimately did in Jones, explained Ken Warwick, who is also an “Idol” exec producer. “There might be other false names and other . . . charges that we just don’t know about,” Warwick said.

Jones dramatically became the 13th member of the “Top-12” when the show’s three judges — Steven Tyler, Jennifer Lopez and Randy Jackson — regretted their decision to weed out the 6-foot-8 baritone dubbed “The Gentle Giant” by show host Ryan Seacrest. You know — just like last fall, when Simon Cowell regretted tossing Melanie Amaro as one of his team members on his singing competition show, “The X Factor”; he melodramatically went to her home in Florida to beg her to take him back. And then Melanie went on to win the whole thing. Great TV.

Only, the Jermaine Jones story has not played out in quite the same way. On Wednesday morning, the Smoking Gun posted court documents alleging that Jones is wanted in four counties for failing to appear in court on various criminal charges dating to 2006.

This Web site has previously posted information about other Idolettes that got them bumped off the show.

The oldest warrant regarding Jones stems from a 2006 narcotics arrest, according to the Web site. In 2008, Jones allegedly was cited on an open-container charge. In ’09, he got busted for providing cops with a false name, Smoking Gun says. And 2011 was a busy year for Jones: He was nabbed twice, and both times gave new names to authorities.

This guy’s had more names than Sean P. Puff Diddy Daddy Combs.

CBS renews 18 shows

CBS has renewed 18 of its prime-time series for next season. The list does not include “Two and a Half Men” because, CBS notes, they’re still negotiating with Ashton Kutcher about coming back.

Kutcher had signed on for only one season; although he has said he’s very happy doing the show, it’s unclear how much money it will take to keep making him happy.

Anyway, assume CBS wants very much to have that show back, too.

The list of shows not getting an early pickup is much shorter so we’ll go with that list:

●Rob Schneider’s new sitcom, “Rob”

●David Spade’s sitcom, “Rules of Engagement”

●“CSI: NY”

●“CSI: Miami”

●Freshman cop-can’t-forget-anything drama “Unforgettable”

●Frosh doc-sees-dead-wife drama “A Gifted Man”

It’s important to note: This does not mean all those series are canceled. Indeed, according to press pronouncements, “Rules of Engagement” has been dead more times than Rasputin — and yet, is now celebrating its sixth season on the network.