Tuesday’s results:

● Republican congressman Lou Barletta will face Democratic incumbent Robert P. Casey Jr. in the high-stakes race for U.S. Senate in Pennsylvania.

● In Idaho, Democrat Paulette Jordan will face Republican Lt. Gov. Brad Little in the race for govenror.

● Nebraska Democrats in the 2nd Congressional District nominate nonprofit executive Kara Eastman to face Rep. Don Bacon (R).

● Republican Scott Wagner will face incumbent Democrat Tom Wolf in the race for Pennsylvania governor.

● Nebraska state Sen. Bob Krist (D) will face incumbent Republican Pete Ricketts in the race for governor.

Pennsylvania Democrats took a major step toward upending the state’s all-male, Republican-dominated congressional delegation Tuesday, nominating competitive candidates, including women intent on breaking barriers two years after the state rejected Hillary Clinton.

In a state crucial to their shot at House and Senate majorities, Democrats turned out in high numbers to settle crowded primaries. They put themselves in position to gain as many as a half-dozen House seats in November and are all but assured of sending at least three women to Congress.

But President Trump’s presence could still be felt in the state, as a close ally, Rep. Lou Barletta, won the GOP Senate primary. His victory sets up a showdown with two-term Democratic Sen. Robert P. Casey Jr., who has stockpiled nearly $10 million for the race. Trump had recorded an automated telephone message praising Barletta that was sent to voters just before the election.

“The media said that Donald Trump could not win in Pennsylvania, and Pennsylvania put Donald Trump in the White House,” Barletta told his supporters in Hazleton. “They say I can’t beat Bob Casey, and I’m going to beat Bob Casey.”

Democratic turnout was running far ahead of Republican turnout in Pennsylvania late Tuesday, even though the Democrats had just one competitive statewide race — the usually sleepy lieutenant governor’s contest. With nearly 90 percent of precincts reporting, Democrats had cast nearly 100,000 more votes than Republicans. In Erie County, where Republicans saw one of their most dramatic surges in 2016, Democrats cast 5,000 more votes than the GOP.

The general election in Pennsylvania will serve in part as a test of Trump’s appeal two years after he became the first Republican presidential nominee to win the state in 28 years — a victory he still talks about. Trump tweeted his congratulations to Barletta on Wednesday morning, casting him as someone to help the president with his agenda.

Trump met with Senate Republicans at the Capitol on Tuesday and spoke optimistically about the party’s Senate prospects in November. The GOP holds a ­razor-thin 51-to-49 advantage, but leaders are increasingly bullish about adding to their majority as Trump’s approval ratings have ticked up.

Pennsylvania is one of 10 states Trump won where a Democratic senator faces a reelection race this year. But strategists in both parties think Casey has the advantage.

The state has shown signs of trending Democratic since Trump’s historic defeat of Clinton. In March, Democrat Conor Lamb won a special election in a ­Pittsburgh-area district where Trump had defeated Clinton by 20 percentage points.

A redrawn congressional map and a string of House Republican retirements have given Democrats more reasons to be optimistic about Pennsylvania. There, they are hoping to pick up a chunk of the 23 seats they need to win the House majority.

Ballots were cast Tuesday in four states where primary outcomes provided fresh signs about voters’ mood less than six months before Election Day. In addition to Pennsylvania, there were nominating contests in Nebraska, Idaho and Oregon.

The president used Twitter to urge Nebraska Republicans to “make sure you get out to the polls and VOTE” for Sen. Deb Fischer, who defeated four little-known challengers. Fischer is favored to hold her seat in November. She will face Democrat Jane Raybould, who attracted widespread attention when she repeatedly refused to say in a television interview whether she would have voted for the sweeping GOP tax law. Trump also sent a congratulatory tweet to her Wednesday.

In Nebraska’s 2nd Congressional District, a pickup opportunity for Democrats, former congressman Brad Ashford (D) lost to nonprofit executive Kara Eastman. She will face Rep. Don Bacon (R).

Nebraska Republican Gov. Pete Ricketts easily defeated his primary challenger. He is favored to win a second term in November.

In Pennsylvania, the retirement of Rep. Ryan Costello (R), the resignation of Rep. Patrick Meehan (R) and a revised map ordered by the state Supreme Court have led the GOP to effectively cede two House districts in the Philadelphia area.

Democrats Chrissy Houlahan, Mary Gay Scanlon and Madeleine Dean were nominated in districts that Democrats are favored to win in November. In another district Democrats are aggressively contesting, they nominated Susan Wild.

All told, Democrats nominated seven women for the House in Pennsylvania. Republicans nominated one.

“We’re beyond thrilled at what is going on tonight,” said EMILY’s List President Stephanie Schriock.

Scanlon and Wild defeated male candidates backed by Sen. Bernie Sanders (I-Vt.), who involved himself in several of Tuesday’s contests.

Elsewhere, Democrats were trying to unseat Rep. Brian Fitzpatrick (R) in a swing district. Wealthy philanthropist Scott Wallace won the Democratic nomination against him.

Republican Rick Saccone, who lost to Lamb, was denied a chance for redemption in a primary for a Pittsburgh-area district that favors the GOP. He lost to state Sen. Guy Reschenthaler. Lamb opted to run in a different district near Pittsburgh that is less conservative. He will face Rep. Keith Rothfus (R) in November.

Democratic Gov. Tom Wolf will face Republican state Sen. Scott Wagner in the general election. Voters also decided the outcomes in contested primaries for lieutenant governor in both parties.

In the Democratic race, John Fetterman, the longtime mayor of a struggling industrial town who was backed by Sanders and who ran on universal health care and legalizing marijuana, defeated Lt. Gov. Mike Stack by an unexpectedly large margin. Stack had been dogged by reports that he and his wife mistreated state employees.

Republicans nominated businessman Jeff Bartos for lieutenant governor.

While strategists in both parties are monitoring the Senate race in Pennsylvania, most are not counting on the seat flipping Republican.

In the phone message he recorded, Trump called Casey the “hand-picked guy” of Senate Minority Leader Charles E. Schumer (D-N.Y.), using a strategy Republicans have deployed in other states to tie candidates to party leaders.

But Democrats were not as worried about those attacks resonating in Pennsylvania, compared with some other states Trump won. And Casey has built a much bigger campaign account than Barletta, giving them another reason to be confident he will prevail in November. As of late April, Barletta had about $1.3 million in his campaign account. Casey had more than $9.9 million.

In Idaho, a competitive Republican primary for governor featured three leading candidates: Rep. Raúl R. Labrador, a founding member of the hard-right House Freedom Caucus; Lt. Gov. Brad Little, who had the support of outgoing Gov. C.L. “Butch” Otter; and Tommy Ahlquist, a businessman and physician who ran with the backing of 2012 presidential nominee Mitt Romney.

The Associated Press called the race for Little early Wednesday morning.

Democrats nominated Paulette Jordan, a former state lawmaker who would be the country’s first Native American governor, over A.J. Balukoff, the party’s 2014 nominee.

“People are ready for something new,” Jordan said in an interview. “I’m not about the party; I’m not about the system.”

Farther west in Oregon, incumbent Democratic Gov. Kate Brown defeated a pair of primary challengers. She will face state legislator Knute Buehler, who won the Republican nomination.

Oregon is a heavily Democratic state, and Brown is favored to retain the governorship this fall.