Democrats rode to victory in Tuesday's hotly contested gubernatorial elections, as Ralph Northam defeated Republican Ed Gillespie in Virginia and Phil Murphy beat Republican Kim Guadagno in New Jersey.

The victories -- especially the win in Virginia -- are a shot in the arm to the beleaguered Democratic Party, which has lost four special congressional elections to Republicans since Donald Trump was elected president a year ago.

Northam, Virginia's lieutenant governor, won with the support of federal government employees and non-white voters, according to the Fox News Voter Analysis.

Northam garnered 54 percent to Gillespie's 45 percent, with 99 percent of precincts reported.

As he began his victory speech late Tuesday night in Fairfax, Northam was briefly ushered off stage by security after several pro-sanctuary cities protesters in the crowd began hecklingthe MS-13 gang.

The race between Gillespie and Northam had gotten particularly nasty in recent weeks, with each side accusing the other of running ads that were out of line and racially tinged.

VIRGINIA GUBERNATORIAL RACE GUIDE

Last week, a liberal group called the Latino Victory Fund released a television ad showing immigrant and minority children in Virginia being chased down the road by a man in a pickup truck with a Confederate flag and a Gillespie bumper sticker. Republicans decried the ad, accusing Democrats of fear-mongering. The group behind it eventually took the ad down after last week’s terrorist attack by truck in New York.

Meanwhile, Democrats repeatedly protested ads from Gillespie accusing Northam of voting for bills that would lead to a threat increase from the MS-13 gang. In a