WASHINGTON — Senator Joe Manchin III announced on Tuesday that he would not run for governor in his home state of West Virginia, ending speculation about the future of one of the Senate’s few moderate Democrats — and bringing relief to party leaders who feared Republicans would win his seat if he stepped down.

“Those who know me know how much I loved being the governor of West Virginia,” Mr. Manchin, who served in that role from 2005 to 2010, said in a statement. “I worked the daylights out of that job. I couldn’t wait to wake up in the Governor’s Mansion in the morning, and I didn’t want to go to bed at night, because there was always more that I could do for our state.”

But he said he could not make a decision based on what job he liked most, but rather on where he could be most useful.

“Ultimately, I believe my role as U.S. senator allows me to position our state for success for the rest of this century,” he said, by working on issues like jobs, energy, health care and the environment. Mr. Manchin serves as the top Democrat on the Senate Committee on Energy and Natural Resources.