In 2009, a dark comedy made completely in Panama became a record-busting box office hit, taking both filmmakers and audiences by surprise.

Backed by local investors, Abner Benaim’s $1.2 million “Chance” is a delightful farce about two housekeepers who turn on their bosses. “When we made it, there were no incentives either from Panama’s institutions or government; it was made solely through risk investment,” says its Mexican producer Matthias Ehrenberg. All the equipment had to be brought in, he recalls.

Cut to 2013: the producers of the $17 million biopic “Hands of Stone” have taken advantage of a 15% cash rebate and a $2.8 million advance from the Panamanian government, the latter expressly offered to make sure they lensed the story about their national hero Roberto Duran in his native land.

“They gave us full support, dozens of free locations and a level of hospitality that made everyone feel at home,” says helmer Jonathan Jakubowicz (“Secuestro Express”). With 15,000 extras and a stellar international cast led by Robert De Niro, Edgar Ramirez, Ellen Barkin, John Turturro and Usher Raymond, “Hands of Stone” recreated four cities and four decades in Panama. “The footage is a million times better than even I expected,” Jakubowicz says.

One thing hadn’t changed. Film equipment was scarce and of relatively poor quality. “We invited some of the biggest rental houses in Latin America to set up shop in Panama using our movie as a start, and they did,” he says. “Panama now has top-of-the-line equipment for rent, a great catering service and even a former U.S. Air Force hangar we turned into a soundstage.”

As the film law stipulates, foreign productions can receive a 15% cash rebate on all expenditures in Panama, with a minimum spend of $3 million and a maximum of $40 million. There is no annual cap. Qualified spend includes airfare on national air carrier Copa Airlines, hotels, car rentals, catering, equipment rentals, local labor and location fees. All import duties on film equipment brought into Panama are waived.

In addition, overall costs in Panama for lodgings, transportation and food are generally 20% to 25% lower than in the U.S., Puerto Rico or Hawaii.

Panamanian private investors in local cinema can tap a tax rebate of 27% in pics pre-selected by an international jury. While local productions can’t take advantage of the 15% cash rebate, they can apply for grants from the country’s $3 million annual film fund.

An international jury selects six grant winners a year: three fiction or animated films and three documentaries, according to Panama Film Commission head Arianne Benedetti. Three fiction runner-ups can apply for the private investor tax break. International co-productions may apply if the helmer is Panamanian.

The film fund grants up to $1 million per feature film and $100,000 each to docus per year. This year’s selected pics include Enrique Castro’s docudrama “Sultan,” Ricardo Aguilar’s family drama “Salsipuedes,” Aldo Valderrama’s actioner “Kimura,” and “Historias del Canal,” five shorts spanning a century on lives impacted by the Panama Canal.