Gov. Gina Raimondo of Rhode Island defeated a liberal challenger in a Democratic primary election on Wednesday, according to The Associated Press, reasserting herself as the party’s leader in a state where she has battled criticism from activists on the left and intransigence from old-guard lawmakers in her own camp.

Ms. Raimondo, 47, is expected to face a serious fight for re-election in November despite Rhode Island’s Democratic lean and the difficult political climate for Republicans nationwide. Polls have consistently shown her vulnerable to defeat, though she and her allies believe it will be difficult for any Republican to escape the shadow of President Trump, who is fairly unpopular in the state.

She will face Allan Fung, the Republican mayor of Cranston who also ran against her four years ago in November.

Complicating matters for both parties, Joe Trillo, a former Republican state legislator who chaired Mr. Trump’s campaign in Rhode Island, is also running for governor as an independent.