Rep. Mark Sanford, R-S.C., listens to the crowd respond during a town hall meeting March 18, 2017 in Hilton Head, South Carolina. Sanford lost his re-election bid June 12, 2018.

Sean Rayford, Getty Images

Corrections and clarifications: An earlier version of this story misstated the impact of an affair on Mark Sanford's political career.

WASHINGTON – For Mark Sanford, the Republican Party looks a lot like the party of President Donald Trump.

The sitting Republican House member lost his primary race to state Rep. Katie Arrington, who campaigned as a Trump ally, after the president made a last-minute endorsement of Arrington. Sanford has been one of the few members to criticize the president, and GOP primary voters punished him for it, handing him his first electoral defeat.

Some folks who were not feeling the sting of defeat? Women, particularly Democratic women, who won primary elections across the country.

And the effects of Maine's new voting system was still to be determined. Hours after the polls closed, votes were still being tabulated.

Here are some takeaways from Tuesday's primaries in South Carolina, Maine, Virginia and Nevada.

President Donald Trump waves from Air Force One after the historic US-North Korea summit in Singapore on June 12, 2018.
On his way back to the U.S. Trump tweeted an endorsement of Rep. Mark Sanford's primary opponent, it could have cost Sanford the race.

Saul Loeb, AFP/Getty Images

It's Trump’s party

Just three hours before the polls were supposed to close in South Carolina, Trump inserted himself into an already tight race between Sanford and Arrington. Trump said he endorsed Arrington over his party's incumbent lawmaker because Sanford — who has never hesitated to criticize the president — was “very unhelpful” and “nothing but trouble.”

It was the first election loss for a politician who is no stranger to controversy. Sanford's political career was damaged in 2009 over an affair, but he won his House seat just a few years later. Arrington had been running as a Trump ally while highlighting Sanford's criticism of the president.

Sanford isn’t the only incumbent whose criticism of Trump hurt in the primary. Alabama Republican Rep. Martha Roby was forced into a runoff last week. She came under fierce fire in her GOP primary for withdrawing her endorsement of Trump in the 2016 presidential race after the "Access Hollywood" tape revealed Trump's boasts about grabbing women by the genitals. Roby's opponent, Bobby Bright, a one-time Democratic congressman, ran ads accusing Roby of turning “her back on President Trump when he needed her the most.”

On the flip side, support from the president was not enough to keep South Carolina Gov. Henry McMaster from a runoff after he failed to secure over 50 percent of the vote, but it did have him leading by a significant margin. McMaster — who was an early endorser of the president’s — has gotten Trump’s blessing via Twitter.

In this Wednesday, April 11, 2018 photo, Virginia State Sen. Jennifer Wexton, D-Loudon, center, talks with Sen. Scott Surovell, D-Fairfax, left, during the Senate special budget session at the Capitol in Richmond, Va. Wexton is one of the candidates in the crowded June Democratic primary that will produce a viable contender in the district representing northern Virginia suburbs and challenge Republican Barbara Comstock.

Steve Helber, AP

Women — especially Dems — keep winning

In almost every race where a woman ran in Virginia she won. Democratic women won their primaries in Virginia’s 7th and 10th Congressional Districts. Both districts are held by Republicans but are on Democrats radar for the fall, with the 10th being one of their top targets. Former CIA officer Abigail Spanberger won Democrats’ nomination for Virginia’s 7th District and state Sen. Jennifer Wexton beat a crowded field for the 10th.

Republican Shion Fenty, an administrative assistant, was the rare Virginia woman to lose her primary to a man. She lost to evangelical pastor Ryan McAdams for the GOP nomination for Virginia’s 4th Congressional District.

In Nevada, Rep. Jacky Rosen easily secured the Democratic nomination for Senate. Susie Lee, an education advocate, won her crowded primary for the 3rd Congressional District by a majority of the vote.

But it wasn't just Democratic women who won. Arrington beat incumbent Sanford for the GOP nomination in South Carolina.

Tuesday's results weren't the first example of Democratic women succeeding this primary season. From Pennsylvania to New Mexico and Kentucky to Nebraska, female candidates, particularly Democrats, have been winning their primaries.

Dave Wasserman, the editor of the nonpartisan Cook Political Report said that women were nominated as the Democratic candidate in the general election almost half the time, compared to just a sixth on the GOP side.

Remarkable: after tonight, Dems have nominated women in 73/150 (49%) of '18 House races (excluding Dem incumbents). On GOP side, just 18/112 (16%).

UPDATE: so far in 2018 Dem House primaries featuring at least one woman, one man & no incumbent, women have been the top vote-getters in 66/93 cases (71%). On GOP side, just 9/26 (35%). Never seen anything like it.

Maine Attorney General Janet Mills, left, who is one of seven Democrats facing off in a gubernatorial primary, greets voters outside a polling place, Tuesday, June 12, 2018, in Portland, Maine. The election is the first statewide primary to utilize ranked-choice voting.

David Sharp, AP

New voting systems leave much to be determined

Like we found in California, there's still much to be determined about new voting systems. Maine voters tried Instant Runoff Voting for the first time Tuesday, and at the same time they voted on whether to keep the system.

Under Instant Runoff Voting, first-choice votes are counted and, if no candidate gets over 50 percent, the candidate with the lowest number of votes is removed from the race. Those who gave that candidate their first-choice pick have their votes redirected to their second choice. The process is repeated until a candidate has a majority of the vote and is declared the winner.

Mainers voted in 2016 to start using the service. Voters went back to the polls Tuesday to determine if they would keep using it. They rejected a legislative delay of ranked-choice voting, meaning the system will be used in federal elections in November in the state.

The Associated Press called Maine's Republican gubernatorial primary for businessman Shawn Moody, but the Democratic primary wasn't being called because no candidate was close to a majority.

Because no candidate could be declared the outright winner, more tabulations are required next week under the state's new ranked-choice voting system.

It's a tough year to be a GOP incumbent

Sanford's loss Tuesday may have been one of the most high profile, but he joins a line of his Republican House colleagues who have lost their primary — like Rep. Robert Pittenger — or bid for higher office this cycle.

Two House GOP members in Indiana, Reps. Luke Messer and Todd Rokita, ran for their party's nomination for the Senate — both lost to wealthy businessmen. West Virginia Rep. Evan Jenkins lost his bid to be the Republican Senate nominee to the state's attorney general. Rep. Raul Labrador, a Freedom Caucus colleague of Sanford's, lost his campaign to be the GOP nominee for Idaho governor.

There have been a couple of bright spots for GOP incumbents: Rep. Lou Barletta, a Trump ally, will take on Democratic Sen. Bob Casey in November, and Rep. Kristi Noem won her party's nomination for South Dakota governor.

Primary voters head to the polls in five states

A resident arrives to cast her vote at a polling station at the Kennebunk Town Hall in Kennebunk, Maine on June 12, 2018.

People wait in line at Travelers Rest City Hall in Travelers Rest, S.C. to vote in the primary elections on June 12, 2018.

Ruth Schafer, left, places her ballot into the digital voting machine at Northridge Elementary School in Bismarck, North Dakota for District 35 during the primary election on June 12, 2018.

Democratic candidate Dan Ward, who is running in the 7th District primary against Abigail Spanberger, shakes hands with the Rev. Gene Woodson, pastor of the Mt. Pleasant Baptist Church in Keene, Va., as Ward campaigns outside Henrico High School in Richmond, Va.

Finn, a golden retriever puppy, decides to take a rest in the middle of auditorium after owner Korey Pow cast her vote at a polling station in the Kennebunk Town Hall in Kennebunk, Maine on June 12, 2018.

A woman votes at Reno High School in Reno, Nev. during the Nevada primary on June 12, 2018.

Democratic candidate Dan Ward, who is running in the 7th District primary against Abigail Spanberger, shakes hands with the Rev. Gene Woodson, pastor of the Mt. Pleasant Baptist Church in Keene, Va., as Ward campaigns outside Henrico High School in Richmond, Va.

06/08

Finn, a golden retriever puppy, decides to take a rest in the middle of auditorium after owner Korey Pow cast her vote at a polling station in the Kennebunk Town Hall in Kennebunk, Maine on June 12, 2018.

07/08

A woman votes at Reno High School in Reno, Nev. during the Nevada primary on June 12, 2018.