Ex-CIA analyst Tim Ballard is now a sex-trade investigator — and he just cracked a major ring in Haiti that liberated 29 young women and children.

It was all in a day’s work for Ballard, who teams with a nonprofit called Operation Underground Railroad, made up of former members of the US military who use their know-how to battle child-trafficking and sex slavery in countries where the practices are common.

The Haiti operation, called Sainte Jou — Creole for Blessed Day — led to the arrest of nine suspected sex traffickers on Feb. 5, Super Bowl Sunday, by local authorities, who worked in tandem with the US organization.

“We are not a rogue agency, we are not vigilantes,” said Matt Osborn, a CIA and State Department veteran, who helps Ballard direct the group’s operations.

They target locales notorious for sex trafficking and then set up complex sting operations to nab the pimps and free the young women and girls.

In Haiti, a sting was set up at the Kaliko Beach Club, a high-end resort on the west side of the island of Hispaniola, which is shared by Haiti and the Dominican Republic.

On Feb. 3 and 4 — as Americans were preparing their Super Bowl parties — Osborn said a team of 25 men began flying in to “play the role of middlemen for wealthy American pedophiles.” They organized with the pimps to line up local girls — some as young as 13 — for an orgy.

“The average price we were going to have to pay was $300 for each girl, for what was billed as a sex party of four to six hours,” Osborn said.

By Sunday, a yacht moored off-shore was made to look like a wealthy party boat down from Florida for the weekend.

Most of the undercovers were wearing flip-flops and shorts and playing ball on the beach to give off a party vibe.

Ballard, who worked for the Department of Homeland Security as a special agent, met face-to-face with the pimps and recorded the details of the deal to hand over to Haitian authorities, who swooped in to break up the sex ring.

The US State Department said Haiti only passed legislation criminalizing sex trafficking in 2014.