WASHINGTON — Senator Joe Manchin III of West Virginia told colleagues on Tuesday that he intended to run for re-election this year after all, ending an anxiety-making flirtation with retirement and easing Democratic fears that the most conservative Democrat in the Senate was about to effectively hand his seat to a Republican.

In an interview, Mr. Manchin said he repeatedly expressed his frustration to Senator Chuck Schumer of New York, the Democratic leader, and other colleagues, telling them that “this place sucks,” before finally signaling Tuesday morning to Mr. Schumer’s aides that he would file his re-election paperwork before West Virginia’s deadline on Saturday.

“I was very vocal,” Mr. Manchin said, adding, “they read between the lines.”

Even as Democrats won a reprieve, Mr. Manchin’s discontent illustrated the divisions in their party between those from states that President Trump easily carried and the more liberal bloc of senators, at least a half-dozen of whom are positioning themselves for possible White House runs. The rift contributed to the government shutdown over the weekend and the Monday decision by a group of moderates to force the government’s reopening.

It also will have to be bridged if Democrats have any hope of regaining the Senate in November, when they must defend 10 seats in states that Mr. Trump won, while winning Republican-held seats in difficult states like Tennessee, Nevada and Arizona.