Gov. Bill Walker of Alaska, a political independent who has been fighting an uphill battle for a second term, suspended his campaign on Friday and announced he was throwing his support behind his Democratic challenger. With only a few weeks before the election, the announcement upended the race, which until now had three candidates.

“I believe we cannot win a three-way race,” said Mr. Walker, a former Republican who left his party to win election as an independent in 2014. Mr. Walker said he had concluded that former United States Senator Mark Begich, a Democrat, “has a better chance of running a competitive race” against their Republican opponent, Mike J. Dunleavy, a well-financed Republican former state senator.

“Alaskans deserve a choice other than Mike Dunleavy,” Mr. Walker said. He urged his followers to vote for Mr. Begich even though his own name will still be on the ballot.

The announcement, which came as a shock to many, added chaos to a race in a pivotal time for the state. Alaska has struggled for years with a financial crisis in the capital, Juneau, and the next governor will face significant challenges. A recession has erased thousands of jobs as the oil industry, crucial to the economy, has slumped. Rising crime and homelessness have become major issues especially in Anchorage, the state’s largest city.