The marquee election on Tuesday evening, the Republican Senate primary in Pennsylvania, is going down to the wire, but consequential races were decided, setting up general election matchups for the fall.Here is a rundown of the winners and losers in some of the most important contests:The Mehmet Oz, Dave McCormick and Kathy Barnette race in Pennsylvania is too close to call, despite Trump’s endorsement.The high-spending Republican Senate race in Pennsylvania, between Dr. Mehmet Oz, the celebrity television physician, and Dave McCormick, the wealthy leader of a hedge fund, is nail-bitingly close. Neither candidate conceded, and an official recount is likely.Both Dr. Oz and Mr. McCormick are rich, resided in other states for years, and spent millions attacking one another. Though former President Donald J. Trump endorsed Dr. Oz, the race was extremely tight, with thousands of mail-in ballots to be counted starting Wednesday.Another candidate, the author and 2020 election denier Kathy Barnette, surged to an unexpectedly strong third-place showing, in part by casting herself as the more authentic MAGA candidate. Ms. Barnette, who publicly espoused homophobic and anti-Muslim views for years, also benefited by a late advertising blitz from the influential anti-tax group Club for Growth.Doug Mastriano, an election denier, won the Republican primary election for governor in Pennsylvania.Doug Mastriano, a retired colonel and state senator who has propagated myriad false claims about the 2020 election and attended the protest leading up to the Capitol riot, won the Republican nomination for Pennsylvania governor.He defeated a crowded field of challengers and was endorsed just a few days ago by Mr. Trump. He will face Josh Shapiro, the attorney general of Pennsylvania who emerged unopposed from the Democratic primary for governor.Mr. Shapiro’s victory lap on Tuesday was cut short. He announced earlier that day that he had tested positive for the coronavirus with mild symptoms and was isolating.With Mr. Mastriano’s victory, Republicans will now try to win a battleground state with a central figure in trying to overturn the state’s 2020 election results.John Fetterman got a pacemaker hours before winning the Democratic Senate primary in Pennsylvania.John Fetterman, the lieutenant governor, had a stroke on Friday and a pacemaker put in on Tuesday, which kept him off the campaign trail in the waning days of the race.In November, he will try to help Democrats pick up a key Senate seat that is being vacated by Republican Patrick J. Toomey, a fiscal conservative who occasionally broke with his party.Gisele Barreto Fetterman speaking at the watch party for her husband, John Fetterman, after he won the Democratic Senate primary.Maddie McGarvey for The New York TimesMr. Fetterman dominated the race, wearing a uniform of sweatshirts and shorts while tapping into voters’ frustration with Washington. In the primary, he defeated Representative Conor Lamb, a moderate some thought could appeal to white, blue-collar workers the party has been losing for years, and Malcolm Kenyatta, a young state legislator and rising star in the party who got married just over two months ago.Ted Budd, anointed by Trump, won North Carolina’s Republican Senate primary in a runaway victory.Representative Ted Budd, who was endorsed by Mr. Trump and the influential anti-tax group Club for Growth, won the Republican nomination for Senate. Mr. Budd, who skipped all four debates in the race, defeated nine other candidates, including Pat McCrory, a former governor, and former Representative Mark Walker.Cheri Beasley, a former chief justice of North Carolina’s Supreme Court and the first Black woman to have served in that role, will face Mr. Budd after cruising to victory in the Democratic primary for Senate. The outcome never appeared to be in doubt, with Democrats clearing the field of serious challengers for Ms. Beasley, who would become North Carolina’s first Black senator if elected.Republicans are done with Madison CawthornCrumbling under the weight of repeated scandals and blunders, Representative Madison Cawthorn was ousted on Tuesday by Republican primary voters in western North Carolina, a stinging rejection of the Trump-endorsed candidate.Mr. Cawthorn, 26, lost to Chuck Edwards, a state senator, in a crowded primary in the 11th District that resembled a recall effort for many Republicans, who grew fed up with Mr. Cawthorn’s antics.Representative Madison Cawthorn of North Carolina shortly before conceding his race Tuesday night.Logan R. Cyrus for The New York TimesAt about 10:30 p.m., Mr. Cawthorn conceded the race to Mr. Edwards, who had gained the support of many prominent Republicans in North Carolina, including Senator Thom Tillis.Mr. Cawthorn, who entered Congress as a rising star in 2020, was besieged by scandal, from falsely suggesting that his Republican colleagues routinely throw cocaine-fueled orgies, to being detained at an airport after trying to take a loaded gun through security. Last month, after salacious images of him surfaced online showing him wearing women’s lingerie as part of a cruise ship game, he wrote on Twitter that “digging stuff up from my early 20s to smear me is pathetic.”A 26-year-old political novice won a House primary in North Carolina with Trump’s helpBo Hines, a 26-year-old political novice who enthralled Mr. Trump, drawing inevitable comparisons to another North Carolinian — Mr. Cawthorn — catapulted to a win in the Republican primary for a House seat outside Raleigh.Mr. Hines, a onetime football phenom who was an All-American at North Carolina State University before transferring to Yale, topped seven other candidates in the primary in the 13th District.His victory is perhaps the most audacious example of Mr. Trump’s influence over the Republican Party, with the former president endorsing Mr. Hines in March in the newly drawn tossup district. Mr. Hines was also backed by the Club for Growth, the influential anti-tax group.Mr. Hines will face Wiley Nickel, a two-term state senator and criminal defense lawyer who did advance work for President Barack Obama. He positioned himself as a progressive who can work with people on both sides of the aisle.Idaho’s Republican governor stamped out a Trump insurgent: the lieutenant governorGov. Brad Little of Idaho weathered a Republican primary challenge by Janice McGeachin, the lieutenant governor, who had been endorsed by Mr. Trump and made headlines for defying Mr. Little’s pandemic orders.Ms. McGeachin had sought to win over ultraconservatives in the deep-red state that Mr. Trump overwhelmingly carried in 2016 and 2020. She had played up how she had issued a mutinous but short-lived ban on coronavirus mask mandates when Mr. Little had briefly left the state.But Ms. McGeachin appeared to muster less than 30 percent of the vote in Idaho, which holds separate primaries for governor and lieutenant governor — the genesis of the strained pairing.An establishment Democrat thwarted a far-left rival running for the House in KentuckyIn an open-seat race in Kentucky’s only blue House district, Democrats favored an establishment candidate in Tuesday’s primary over a rival state lawmaker who ran on the far left and has been a vocal leader of the police accountability movement in Louisville.The party favorite, Morgan McGarvey, the Democratic leader in the State Senate, defeated Attica Scott, a state representative, in the Third District. The two had been vying to succeed to Representative John Yarmuth, who was first elected in 2006 and is retiring. The chairman of the House Budget Committee, Mr. Yarmuth is the lone Democrat from Kentucky in Congress. More