Embattled city “Taxi King” Gene Freidman must hand over 46 of his taxis — and the ultra-lucrative medallions that go with them — to pay off creditors, a judge has ruled.

Freidman, who owes money to everyone from the state and city to a former landlord who evicted him, must turn over the cars and medallions by Jan. 9, said US Bankruptcy Judge Carla Craig.

“This strikes me as a crisis that Mr. Freidman has created,” Craig said during an emergency hearing this week.

“I don’t have much sympathy with Mr. Freidman in this situation,” she said.

The judge warned that Freidman will be held in contempt of court and possibly jailed if he doesn’t do what she ordered.

Freidman, who manages more than 800 taxis in New York City, has been on a downward spiral in the past two years.

The state attorney general’s office appointed a trustee to oversee his businesses earlier this year, saying he can’t be trusted to run them himself. Also, his landlord evicted him from his longtime business offices, and his wife sued him for divorce.