COLUMBIA, S.C. — President Trump helped lift a pair of incumbent Republicans locked in difficult races to victory Tuesday while the liberal wing of the Democratic Party scored its most significant successes yet in the primary season, with progressive candidates unseating the fourth-ranking House Democrat and claiming the nominations for governor in Maryland and Colorado.

Already triumphant after the Supreme Court ruled in his favor in two major cases Tuesday morning, Mr. Trump propelled Gov. Henry McMaster to a decisive victory in a runoff in South Carolina, a day after appearing with him at a rally.

And Mr. Trump got another victory in New York, where Staten Island Republicans renominated Representative Dan Donovan, thwarting the comeback bid of Michael Grimm, who was seeking to overcome his conviction on tax fraud and regain his former House seat. Mr. Trump endorsed Mr. Donovan, saying the party couldn’t afford a Grimm candidacy in a district that could swing to the Democrats.