“We are the party of President Donald J. Trump,” she told supporters after the returns made her victory clear on primary night and just hours after Mr. Trump endorsed her campaign with a tweet belittling Mr. Sanford.

“Mark Sanford has been very unhelpful to me in my campaign to MAGA. He is MIA and nothing but trouble,” Mr. Trump said on Twitter. “I fully endorse Katie Arrington for Congress in SC, a state I love. She is tough on crime and will continue our fight to lower taxes. VOTE Katie!”

On Saturday, Mr. Trump tweeted that his “thoughts and prayers” were with Ms. Arrington and those involved in the crash.

Ms. Arrington, who was serving her first term in the State Legislature, harnessed grass-roots anger toward Mr. Sanford over his attacks on Mr. Trump and lingering unease over his well-publicized marital infidelity.

The Democratic opponent she will face in the general election, Joe Cunningham, a lawyer, has assailed Ms. Arrington for her unswerving fealty to Mr. Trump.

After news of the crash, Mr. Cunningham said on Twitter on Saturday that he was suspending all campaign activities until further notice.

“Just hearing about the terrible accident that occurred overnight involving Katie Arrington,” he wrote. “Amanda and I are lifting her and her family up in prayer right now. Please join us.”