“Star Trek” hunk ZACHARY QUINTO beams out of closet, goes public with romance with “Glee” star  JONATHAN GROFF!

Quinto, 34, has been secretly dating Groff, 26, since last year. But sources say he felt he couldn’t take their romance public – until now.

“Zachary had wanted to come out for some time, but his handlers wouldn’t let him,” a source close to the couple told The ENQUIRER.

“They were afraid it might jeopardize his ‘Star Trek’ role as Spock. So Jonathan kept it quiet too.”

Despite that, Quinto and Groff – who plays a rival school’s lead sing­er, Jesse St. James, on “Glee” – were often seen out together in New York and Los Angeles.

The two even double-dated with Groff’s “Glee” co-star Lea Michele and her then-boyfriend Theo Stockman.

“Zachary recently went to see Jonathan in his off-Broad way play ‘The Submission,’” added the source. “They’re both very supportive of one another.”

Quinto shot to fame as super-powered villain Sylar in TV’s “Heroes” and is now starring in the just-released Wall Street drama “Margin Call.” He recently wrote on his blog that he was spurred to reveal his sexuality secret by the tragic Sep­tember suicide of gay teen Jamey Rodemeyer.

“After that, Zachary knew that he had to come out,” said the source.

And the first thing he did was to take his romance with Groff public.

“Zachary and Jonathan are incredibly happy together and very much in love,” said the source. “Who knows? The next step could be marriage.”