By JOHN RABY, Associated Press

CHARLESTON, W.Va. (AP) — When President Donald Trump visited Huntington back in August, there was a surprise in store — West Virginia Gov. Jim Justice came to the podium and told the crowd he was switching from the Democratic to the Republican party.

Justice's party switch was voted the No. 1 news story in 2017 in West Virginia by Associated Press member newspapers and broadcasters.

Politics dominated the news in Justice's first year as governor. An October voter referendum allowing the state to issue $1.6 billion in state bonds to repair and build roads and bridges was rated the second-biggest story, and the struggles between the governor and Legislature to pass a state budget was third.

Justice, the owner of the Greenbrier resort, won the governor's race as a Democrat in 2016, defeating Republican state Sen. President Bill Cole. At a rally with Trump in August, Justice announced his move to the GOP, saying that Democrats in the Legislature had "walked away" from him.

He said West Virginia House Democrats failed to support a tax overhaul he says would have increased the budget and helped many residents. Justice said he believed the change also would help him at the White House, where he had presented proposals for an environmental subsidy for West Virginia's hardwood forests and a homeland security incentive for Eastern coal mines.

Justice's defection left Democrats with just 15 governors among 50 states.

The Herald-Mail of Hagerstown, Maryland, said Justice "thrust himself into the national spotlight and simultaneously joined an elite club in the American history of politics when he switched parties while in office."

In October, voters overwhelmingly approved a $1.6 billion road bond package. The Republican-controlled Legislature earlier passed taxes and fees to support some road repairs and bond repayments, which Justice signed into law. His administration had listed more than 600 planned projects, some in every county, and Justice predicted the program would create tens of thousands of direct and indirect jobs.

Earlier in the year, Justice and the Legislature feuded over budget issues, which threatened a partial government shutdown on July 1 if not resolved. In June, Justice allowed the budget to take effect but he wouldn't sign it, saying the legislative cuts went too deep.

Reporter Kennie Bass of WCHS-TV and WVAH-TV in Charleston said the budget flap "was a big deal, affecting the entire state, and consumed much of the news cycle for several weeks."

Dawn Dayton, managing editor of The Register-Herald in Beckley, said the state budget "is the most important job of the Legislature. Lawmakers and the governor showed their disdain for the people of West Virginia with their infighting and inability to compromise."

Rounding out West Virginia's top 10 stories were:

— Justice signs a bill making West Virginia the 29th state to allow the use of marijuana for certain medical conditions.

— Communities and counties across West Virginia sue out-of-state drug distributors in attempts to recoup the costs of dealing with opioid abuse.

— Trump's speech to the Boys Scouts' national jamboree in July is widely panned for its aggressive political rhetoric and drew a firestorm of criticism.

— Former Massey Energy CEO Don Blankenship is released from federal prison and later files candidacy papers for U.S. Senate.

— Bruce Lamar Griggs of Ohio is sentenced to more than 18 years in federal prison for selling heroin laced with an elephant tranquilizer that caused more than two dozen overdoses in Huntington.

— A federal judge tentatively approves a revised settlement in a class-action lawsuit stemming from a 2014 chemical spill in Charleston, enabling residents and businesses in nine West Virginia counties to start filing claims.

— The U.S. Environmental Protection Agency holds a public hearing in Charleston over the intended repeal of an Obama-era plan to limit planet-warming carbon emissions.