The number of openly gay governors in the United States went from one to three following Tuesday's midterm elections.

Jared Polis, a Democrat, defeated Republican challenger Heidi Ganahl to win re-election in Colorado.

(Related: Colorado Governor Jared Polis marries longtime partner Marlon Reis.)

Voters in Massachusetts and Oregon made history by electing two openly gay Democrats to lead their states.

Maura Healey won the race for Massachusetts governor, defeating Geoff Diehl, a former state representative. Former President Donald Trump had endorsed Diehl's campaign.

Healey served as Massachusetts attorney general since 2015. She is also the first woman elected to the office and the state's first Democrat since Governor Deval Patrick left office in 2014.

Speaking to supporters on Tuesday, Healey talked about the historic nature of her victory.

“Tonight, I want to say something to every little girl, and every young LGBTQ person out there,” she said. “I hope tonight shows you that you can be whatever, whoever you want to be. I stand before you tonight, proud to be the first woman and the first gay person ever elected Governor of Massachusetts.”

In Oregon, Tina Kotek defeated Republican Christine Drazan to become the state's first openly gay governor. Kotek previously made history as the first out lesbian speaker of any state House in the nation.

Kotek succeeds Democratic Governor Kate Brown, who is bisexual.

A Republican has not held the state's highest office since 1987. But this year's election was the tightest in years and the most expensive ever with a combined $68.9 million raised by candidates, according to state data.

Annise Parker, president and CEO of the LGBTQ Victory Fund, which works to elect openly LGBTQ candidates, described Kotek's win as inspirational for the LGBTQ community.

“With anti-LGBTQ attacks sweeping the country, her election will also surely inspire many other LGBTQ leaders to run for office,” Parker said.

The Victory Fund announced on Wednesday that a record number of LGBTQ candidates had won on Tuesday. The group said that at least 340 LGBTQ candidates running in the midterms have won their elections, surpassing the previous record of 336 set in 2020. “To reach equitable representation, the U.S. must elect over 35,000 more out LGBTQ people to office,” the group said.