Visions of America via Getty Images The New York State Capitol in Albany. Democrat Christine Pellegrino defeated Republican Thomas Gargiulo in a special election in a district won by President Donald Trump.

Two districts that voted for Donald Trump in last year’s presidential election selected Democrats for state legislature seats in New York and New Hampshire on Tuesday night.

In a Long Island, New York district that Trump won by 23 percent, Democrat Christine Pellegrino defeated Republican Thomas Gargiulo in the race for a seat in the New York State Assembly. Pellegrino served as a delegate for Bernie Sanders at the Democratic National Convention last year, the local Patch reported.

The seat Pellegrino won on Tuesday had been held by Republican Joseph Saladino, who resigned earlier this year after being appointed to a local office. He had defeated his Democratic opponent in 2016 by 37 points. Prior to 2016, however, that same district voted twice for President Barack Obama, per Ballotpedia.

Democrats are also celebrating an upset in a New Hampshire district that Trump won by 7 points in November. Democrat Edith DesMarais defeated Republican Matthew Plache in a special election for a seat in the state’s GOP-controlled House of Representatives, WMUR reported. That seat had been held by Republican Harold Parker, who resigned to join the administration of Republican Gov. Chris Sununu.

While neither election will change the balance of power, Democrats are hoping the victories may signal a change in the political leanings of the country.

According to The Hill, in the past eight years, Republicans have gained control of 27 state legislative chambers that were once held by Democrats. Following the 2016 general election, the GOP controlled 56 percent of the nation’s state legislative seats.

The stakes will be even higher in two upcoming special elections for the U.S. House of Representatives. Democrat Rob Quist is hoping for an upset win over Republican Greg Gianforte in a race for Montana’s sole house seat later this week, while in Georgia, Republican Karen Handel aims to keep her district red in a race against Democrat Jon Ossoff next month.