Lil Nas X has apologised to the trans community after joking that he transitioned.

The Montero rapper took to Twitter on Wednesday with an apology to his trans fans after he joked that he had transitioned.

In a since-deleted tweet, he posted a photo of a woman with a resemblance to him, writing “The surgery was a success.”

After the rapper - whose real name is Montero Lamar Hill - received backlash for the joke, he admitted it went too far.

“Apologies to the trans community, I (definitely) handled that situation with anger instead of considering why it was not cool,” he wrote on Wednesday. “Much love to you guys. Sorry.”

When one user called the apology “fake as hell”, Montero replied, “Girl eat my a**.”

Montero has been gearing up to release his second album, a follow-up to his debut, titled Montero. In February, he teased the next project could release this summer.

“It’s mostly planning now,” he said at the time. “I could easily just release music but I have to build moments around this s**t. I have to go bigger than before!”