Democrat Danica Roem, a former journalist, defeated incumbent Republican candidate Del. Bob Marshall Tuesday to become the first openly transgender elected official in Virginia.

Roem, 33, is now also set to make history as the first openly transgender person to be elected and seated in a state legislature.

Marshall, 73, is a staunch social conservative who has served in Virginia's House of Delegates since 1992. He once referred to himself as the state's "chief homophobe" and introduced a "bathroom bill" earlier this year that would have required people to use the restroom that matches the gender listed on their birth certificate. The bill never made it out of a Republican-led committee.

More:Virginia, New Jersey voters pick new Democratic governors and set the tone for 2018 elections

Related:Virginia elects second African-American to statewide office, first Latinas to state house

Election Day 2017:Trump distances himself from Ed Gillespie after election loss

Marshall also authored Virginia's constitutional amendment defining marriage as between a man and a woman, and sponsored a bill banning homosexuals from the Virginia National Guard.

Roem's campaign focused on jobs, schools and traffic problems rather than gender identity. She argued that Marshall had spent too much of his energy in office tackling social issues like the bathroom bill.

"For 26 years I've been proud to fight for you, and fight for our future," Marshall said in a Facebook post Tuesday. "Though we all wish tonight would have turned out differently, I am deeply grateful for your support and effort over the years."

Contributing: The Associated Press