Sign up for our special edition newsletter to get a daily update on the coronavirus pandemic.

A German mayor said he got infected with coronavirus “almost on purpose” from his partner, in hopes of developing immunity — and learned that the bug was “a lot worse” than he ever thought, according to a new report.

Stephan von Dassel, 53, district mayor of Mitte, Berlin’s central borough, told public broadcaster RBB that he viewed his illness as a “contribution” toward the long-term goal of flattening the curve, Deutsche Welle reported.

But then the sickness was worse than he had bargained for, he said.

“I was ill longer than I thought,” the mayor said. “I got infected almost on purpose to develop immunity and thought I’ll be a bit sick for three days and then I’ll be immune — I can’t catch it and won’t pass it on to anyone, but it was a lot worse than I imagined.”

His actions go against the recommendations of health officials across the globe, who say people should practice social distancing to slow the spread of the deadly bug and avoid overwhelming health services.

But in a tweet, von Dassel defended his decision as “responsible.”

“Perhaps my statement on the radio today was misleading,” he wrote. “But my behavior was and is responsible. I was, am and remain in quarantine, until I’m no longer infectious.”

He also included a link to a statement he released through his Mitte district office.

He explained that he needed to be quarantined anyway after his partner — with whom he shares an apartment — became infected, and catching the bug was “almost unavoidable.”

The couple does not have a second home, and von Dassel decided against staying at a hotel or with friends just in case he was already infected, he wrote.