Danica Roem on Tuesday defeated Virginia state Delegate Bob Marshall, a Republican from Prince William County, to become Virginia's first openly transgender state legislator.

With 95 percent of precincts reporting, Roem, a journalist, is leading Marshall with a 55-45 percent margin.

In a Facebook post, Marshall, a vocal opponent of LGBT rights, thanked supporters.

“Thank you all for your support over the years and this last election. For 26 years I've been proud to fight for you, and fight for our future. Though we all wish tonight would have turned out differently, I am deeply grateful for your support and effort over the years,” Marshall wrote. “I'm committed to continue the fight for you, but in a different role going forward. Thank you for your support, and God bless.”

As recently as last week, Marshall attacked his opponent's gender identity, saying that he would not use female pronouns to refer to Roem because she defies the “laws of nature” at a “fundamental level.”

(Related: Bob Marshall says transgender opponent Danica Roem defies “laws of nature.”)

Earlier this year, Marshall introduced a bill that sought to prohibit transgender people from using the bathroom of their choice.