Tuesday brought another set of primaries across the country — in Maine, South Carolina, Nevada, North Dakota and Virginia — and another set of surprises. Here are the night's winners and losers.

Winners

President Trump: It's overly simplistic to say that South Carolina GOP congressman Mark Sanford lost his primary Tuesday because of Trump. But Trump was definitely a factor in making Sanford the second House Republican in 2018 to lose a primary. The president sent off this remarkably caustic tweet on Tuesday afternoon, as voters in South Carolina were getting off work and going to vote:

The Argentina thing is a reference to the affair Sanford carried out while governor in 2009, when he went missing for about a week and was discovered to be spending time in Argentina with a woman who wasn't his wife. He somewhat improbably won election to Congress a few years later.

Trump was already making life difficult for Sanford before that tweet. Sanford's primary opponent, state legislator Katie Arrington, tried to frame the campaign about how critical Sanford has been of Trump. It was helping her gain traction even before Trump sent that tweet.

The big takeaway from Sanford's loss is this: Republican lawmakers who speak out against Trump risk losing their jobs. Rep. Martha Roby (R-Ala.) was forced into a runoff after abandoning Trump nearly two years ago during the election.

Ranked choice voting: Twice in two years, Maine voters have been asked to choose whether they want to elect candidates in a whole new way, by ranking them rather than picking just one. Twice, they said yes. On Tuesday, advocates of ranked-choice voting put the question back on the ballot after Republicans in the state legislature repealed the ranked-choice method voters approved in 2016. Voters approved it again. Maine also held the first governor's race in the nation under ranked-choice voting. This experiment in democracy isn't going away anytime soon, no matter how people in power may feel about it.

Female candidates: By now, a trend is firmly established. Women are running for election in much higher numbers than ever before, and a notable number of them are winning their primaries. In Virginia, women won Democratic primaries in four out of four congressional districts that could be competitive this November.

Virginia Democrats overwhelmingly nominated women candidates on June 12, setting up six GOP districts to have female challengers in the fall. (Jenny Starrs/The Washington Post)

That includes one of the most competitive districts in the nation, Rep. Barbara Comstock's in the outer D.C. suburbs. State Sen. Jennifer T. Wexton beat five other candidates in the Democratic primary. This race won't have a winner or loser until November, but it's worth noting that Comstock (R-Va.) ceded nearly 40 percent of the vote to a little-known GOP primary challenger on Tuesday.

Rematches: In 2014, Nevada politics watchers were shocked when Democratic congressman Steven Horsford, a rising political star, lost his outer Las Vegas area district to an unpolished newcomer, Republican Cresent Hardy. Hardy lost the seat after one term. Now the seat is open after the new congressman resigned over a sexual harassment scandal. Both Horsford and Hardy want their old job back; both won their primaries Tuesday, setting up a rematch in one of the swingy-est districts in the nation.

Democrats in Wisconsin: Democrats at the state legislative level continue to win improbable races. On Tuesday, they won a special election to Wisconsin's state Senate, in a district that Trump won by nearly 20 points. It's Democrats' third big special election win in Wisconsin this year alone, and their 43rd state legislative seat they've flipped in the Trump era. This special election almost didn't happen; Gov. Scott Walker (R) tried to cancel it, but the courts forced him to hold it.

Losers

Republican Party unity: Trump's tweet about Sanford did not sit well with a number of Republican lawmakers in Washington, some of whom started a fight with the president publicly over it. Here's tea party-aligned Rep. Justin Amash (R-Mich.):

Earlier in the day, Trump frenemy Sen. Bob Corker (R-Tenn.) accused his fellow GOP senators of being afraid to “poke the bear” by challenging Trump on tariffs. The Republican Party may be Trump's party, but a number of Republicans aren't happy about it.

Senate Republicans' hopes in Virginia: Sen. Tim Kaine (D-Va.) race doesn't appear on our list of top-10 most competitive Senate races, but Senate Republicans were hoping to make it competitive by nominating the right candidate to take him on. On Tuesday, Virginia GOP primary voters ended up nominating a former Trump official who has defended Confederate symbols, Corey Stewart, to challenge Kaine. That means Stewart will lead Republicans' ballot in November's federal elections. In a state that's rapidly trending blue, that's arguably not the direction Senate Republicans want to go. Here's former Virginia lieutenant governor Bill Bolling, a Republican:

Incumbency, period: Being an early backer of Trump doesn't always help save Republicans from primary challenges. Tuesday demonstrated yet again just how strong the anti-incumbency mood is among Republican primary voters.

South Carolina Gov. Henry McMaster will have a runoff against business executive John Warren, even though McMaster was one of the few Republican leaders in South Carolina who supported Trump's presidential bid.