The city is negotiating a sweetheart deal with horse- carriage owners that would give them recession-proof yellow taxi medallions worth about $1 million each to compensate them for a ban on their business, The Post has learned.

Mayor de Blasio has called the hansom cabs “inhumane,” and vowed to replace them in Central Park with a fleet of electric, replica antique cars.

The 68 carriage license owners are hammering out an agreement with the city to make up for their lost livelihood, and giving them taxi medallions is one proposal being discussed, sources said.

That would be a huge payday for the owners, whose carriage licenses are worth a fraction of what a yellow-cab medallion goes for at auction.

A carriage license was recently sold for between $170,000 and $200,000, said Stephen Malone, of the Horse & Carriage Association of New York City.

Yellow-cab medallions went for nearly $1 million at auction this year — and their value has consistently gone up.

De Blasio spokesman Wiley Norvell said, “We’re considering a range of options that would move the horses off our streets, safeguard the animals and protect the livelihoods of the men and women who provide carriage rides.”

The city has had 68 officially licensed horse-drawn carriages since the late 1940s.

Prior to that time, the same medallions were good for both carriages and gas-powered taxis, but then-Mayor Bill O’Dwyer created separate licenses and 68 drivers opted to stick with the horses.

The tourist-friendly industry currently generates about $19 million a year.

City law allows carriage owners to transfer or sell their licenses, subject to approval of the commissioner of consumer affairs.

But the licenses rarely trade hands, with most remaining in the families of the original holders.

Asked about the medallion-swap plan, Malone said, “We’ve been researching that for a while.”

But Malone, a second-generation carriage owner and driver, noted that despite the potential windfall, not everyone was on board with the idea — and some might look the proverbial gift horse in the mouth.

“We’re in the carriage business to stay in the carriage business,” Malone said.

As a city councilman and the public advocate, de Blasio refused to back a ban on carriage horses.

But he was elected last year after beating rival Christine Quinn in the Democratic primary, with TV commercials funded by opponents of the carriage trade.