Aaron Schock, the former Republican congressman from Illinois, came out as gay on Thursday.

Schock, who previously denied rumors about his sexuality, made his announcement in an Instagram post.

“I am gay,” Schock wrote.

The former congressman explained that being candid about his sexuality was difficult for him because he had been raised in an Apostolic Christian home.

“My parents did their best to raise me and my siblings according to biblical tenets as they understood them,” he said.

Schock went on to criticize the media for comparing his elaborately decorated House office to Downton Abbey – “It was another way, albeit more sophisticated, to be teased about being gay. A dog whistle.” – and justify his anti-LGBT voting record by claiming that his opposition to marriage equality while in office was similar to views once held by former President Barack Obama and Secretary of State Hillary Clinton.

“That fact doesn't make my then position any less wrong, but it's sometimes easy to forget that it was leaders of both parties who for so long wrongly understood what it was to defend the right to marry,” he wrote.

(Related: Aaron Schock talks Paul Ryan physique as he strolls through gay neighborhood.)

Schock's announcement came just days after he was photographed in Rio de Janeiro sunbathing with out circuit party promoter Eliad Cohen.

Schock added that his family rejected him after he came out to them.

“As for my family, I still get occasional emails trying to sell me on conversion therapy, but recently at our relative's wedding, my mother told me that if there is anyone special in my life, she wants to meet them. I'm optimistic about the future and ready to write the next chapter of my life,” he wrote.

Schock resigned from Congress amid a scandal involving his use of campaign funds. Prosecutors indicted Schock on 24 criminal counts but all charges were dropped last year.

(Related: Aaron Schock's dad says his son is “a little different” but “not gay.”)