BATON ROUGE, La. — Gov. John Bel Edwards of Louisiana, the only Democratic governor in the Deep South, narrowly won re-election Saturday, overcoming the intervention of President Trump, who visited the state multiple times in an effort to help Mr. Edwards’s Republican challenger and demonstrate his own clout.

It was the second blow at the ballot box for Mr. Trump this month in a Republican-leaning state, following the Democratic victory in the Kentucky governor’s race, where the president also campaigned for the G.O.P. candidate.

In Louisiana, Mr. Trump had wagered significant political capital to try to lift Eddie Rispone, a businessman who ran against Mr. Edwards in large part by embracing the president and his agenda. Mr. Trump campaigned for Mr. Rispone twice in the final two weeks of the race, warning Louisiana voters that a loss would reflect poorly on his presidency — the same appeal he made in Kentucky earlier this month to try to help Gov. Matt Bevin, who ultimately lost.

Of the three governor’s races this year, all in deep red states, Republicans won only one, in Mississippi. Republicans also lost control of both chambers of the state legislature in Virginia, where many Democratic candidates were sharply critical of Mr. Trump.