The American pop-R&B singer, who has had a string of smash hit singles over the past eight years, including Love Lies, Young Dumb & Broke and Eastside, tweeted a rainbow flag emoji, writing: "There yall go. Next topic please lol."
Responding to one person who asked if the tweet meant he was gay, he wrote: "I am! And that's okay."
In another follow-up, he gave a little more context.
"I got outted and the world still continues to turn. Let's get this straight (lmao) I am not ashamed of my sexuality! In reality it ain't nobody's business! But I am okay with me. Love yall," he wrote.
Khalid was referring to a flurry of social media posts by openly gay internet personality Hugo Almonte, who shared a photo of the pair together.
That tweet had followed a series of other posts from Almone alluding to sexual encounters with a "gay R&B singer".
Since debuting with the single Location in 2016 when he was 18, Khalid has had a string of platinum hits, including high-profile collaborations with Billie Eilish and Benny Blanco.