Patrick Ness revealed the news about the upcoming BBC Three drama in the wake of the Orlando shootings, which saw 49 people killed and over 50 injured, after a gunman stormed a gay nightclub in Florida.
Taking to Twitter, he wrote: "Been asked if Class will have LGBT representation in it. Will a lead character with a boyfriend who he kisses & sleeps with & loves do?"
He continued: "We were keeping that secret, but today that secret doesn't seem very important. #lovewins."
Patrick was overwhelmed with the positive response from fans, later tweeting: "Gosh, what a lovely response! I just want to try and tell stories about characters I love. That's how I start anything."
She will be joined by four newcomers - Greg Austin, Sophie Hopkins, Fady Elsayed and Vivian Oparah - who will play sixth-formers.
‘Doctor Who’ boss, Stephen Moffatt, recently said of the show: “There’s nothing more exciting than meeting stars that nobody’s heard of yet. We had the read-through of the first few episodes last week, and there was a whole row of them.
“Coal Hill School has been part of ‘Doctor Who’ since the very first shoot in 1963, but this new show is anything but history.
“‘Class’ is dark and sexy and right now. I’ve always wondered if there could be a British 'Buffy' - it’s taken the brilliant Patrick Ness to figure out how to make it happen.”
‘Class’ follows previous ‘Doctor Who’ spin-offs ‘Torchwood’ and ‘The Sarah Jane Adventures’.
It is set to air on BBC Three later this year.