CHARLESTON, W.Va. (AP) — The Republican-led West Virginia House of Delegates on Wednesday elected Roger Hanshaw as its new speaker to replace state Supreme Court candidate Tim Armstead.

Hanshaw, a Republican from Clay County, was elected over Democrat Tim Miley, who was nominated by his party and had served as speaker until the GOP won the majority in the 2014 elections.

Hanshaw is vice chairman of the House Judiciary Committee. He received 62 votes to Miley's 34.

"We need opportunity as a state," Hanshaw said in a speech to delegates. "Our service is this House gives us an opportunity to make a contribution to our state, to our chosen home, in a way that other citizens in our communities will never have."

Hanshaw, 38, earned his law degree from West Virginia University and has a Ph.D. in chemistry from the University of Notre Dame. He was elected to the House in 2014 and re-elected in 2016.

House Judiciary Committee chairman John Shott, who nominated Hanshaw, said he is "one of the most intelligent people I've met, not just here, but in my lifetime."

And Hanshaw's impressive degrees "don't amount to much unless you couple that with common sense, and that's what I see in Roger," Shott said.

Senate President Mitch Carmichael, R-Jackson, said in a statement that Hanshaw "brings a unique kind of knowledge, experience, and temperament that is critical for this transition period in West Virginia's future. I look forward to working with him in his new role to continue our efforts to move West Virginia forward."

Armstead, a Republican, resigned last week. He and Republican U.S. Rep. Evan Jenkins were picked Saturday by Gov. Jim Justice to fill interim court openings and are running in special elections for the court in November.

Armstead recused himself from House debate over impeachment articles for current Supreme Court justices because he had expressed interest in the court.

Several justices were impeached or retired following questions involving renovations to the justices' offices and accusations of corruption, incompetence and neglect of duty.