It took multiple votes and more than 7 hours, but the NH House did choose a new speaker Wednesday – Hudson Republican Shawn Jasper.

Listen to the sounds from the State House in the broadcast version of this story.

Support from Democrats lifted Jasper to an upset win over former Speaker Bill O’Brien, who Republicans nominated to lead the House last month.

The first sign that yesterday might not end well for Bill O’Brien, came early, when Republicans tried to alter the proposed rules for electing a Speaker.

Instead of a vote by secret ballot – which has been the norm in contested elections – O’Brien’s allies moved to require a roll call vote, to ensure that every lawmaker’s preference in the Speaker’s race would be public.

Windham Republican David Bates proposed the new rules. He mostly pitched this as way to speed things up but also acknowledged the change would make it harder for other candidates to challenge O’Brien.

“We hope that members will adopt these rules and have our organization day proceed as orderly as possible.”

But order wasn’t the order of the day. Democrats, who had never seen the GOP rules, immediately cried foul.

“When I came here to vote today I came by a mountain of ballot boxes,” said Jackie Cali-Pitts, who represents Portsmouth.

“Which mean we were prepared to vote by paper ballot, and I believe that voting in an open ballot is wrong.”

The new rules were also criticized by the man who would ultimately become speaker, Hudson Republican Shawn Jasper. He suggested the push for new rules without giving notice to Democrats wasn’t fair.

“We have been promised that we would have a different kind of house and here we are on our very first, really procedural, vote, and we have a very clear idea of where we are going now.”

But few could have predicted where the house would end up yesterday. The route was circuitous.

For most of the day O’Brien and his allies scrambled to hold things together. They fought parliamentary rulings of the house clerk, and called for a recess mid-debate for a closed door caucus with state GOP chair Jennifer Horn.

They also worked to make the case that electing Bill O’Brien would not deal a blow to collegiality. Rep Rick Ladd represents Haverhill.

“He has the knowledge, the caring attitude and the stated desire to work with members on both sides of the aisle, and this is our opportunity.”

And here’s O’Brien himself:

“I hope that all of you understand that if I am elected speaker, my office door is always open. That this process will always be open, and that I want to talk with every one of you.”

When it was Shawn Jasper’s turn, his backers stressed his ability to work with others, and to disagree without being disrespectful. Jasper himself, suggested O’Brien and his allies weren’t interested in dialogue, only getting their way.

“I just came out of a caucus where I was essentially yelled at for 15 minutes without a change to respond,” Jasper said, eliciting jeers.

“The House will be in order, the member is allowed to Speak,” said House Clerk Karen Wadsworth.

“And this is my concern, this why I am standing here," Jasper continued. "The House deserves better. We deserve to respect each other. I am a Republican, and I know many will say I’m not. I was a Republican before I even registered to vote.”

But without the support of Democrats Jasper could not have won.

After the first ballot, in which Bill O’Brien fell 4 votes shy of the majority he needed, Jasper got in the race, and the Democratic nominee for speaker Steve Shurtleff, dropped out.

Democrats then backed Jasper.

Prior to the final votes, Jasper sought to reassure members of his party that if he was elected, Republicans would lead every committee. But Jasper also said that under his watch, the Speaker’s role would be less political.

“The Speaker should really not be policy this chamber should not be the political arm of this body, that belong to the minority offices and the majority offices.”

Within the hour, the Speaker’s gavel was his. After the 195 to 178 vote Jasper looked stunned, and relieved. And he said he’d save any public reflection for another day.

“This is not a time to make a speech, I understand what a difficult day it was for all of us. It is not my time now, it is your time. So there will be no speech from me today.”

On that last point, the new House Speaker, and the guy most expected to be House Speaker seemed to agree. Bill O’Brien left the hall without comment before the tally of the final vote was announced.

Scroll down for photos and tweets from Wednesday's session.

NH House votes are in 377 cast. 189 to win. O'Brien 178. Jasper 195, and new speaker. Wow. — Josh Rogers (@joshrogersNHPR) December 3, 2014

It's official: Republican Shawn Jasper wins speakership w/ combo of Dems & anti-O'Brien Repubublicans #nhpolitics — Kathleen Ronayne (@kronayne) December 3, 2014

Jasper and O'Brien decide no more speeches. New ballots being passed out right now. — Josh Rogers (@joshrogersNHPR) December 3, 2014

380 votes cast, 191 needed. O'Brien 187, Jasper 190. On we go. — Josh Rogers (@joshrogersNHPR) December 3, 2014

Reminder: Ballots now being counted for O'Brien v Jasper. Either needs majority to win...so it IS possible we could have a third ballot... — Kathleen Ronayne (@kronayne) December 3, 2014

6.5 hours in and we're in an intra-party GOP battle for the speakership. Who would have thought #nhpolitics — Kathleen Ronayne (@kronayne) December 3, 2014

Rep Shawn Jasper tells the house his Speakership would be about "respect." Dem Steve Shurtleff bows out. Now renomination of O'Brien. — Josh Rogers (@joshrogersNHPR) December 3, 2014

@NHJennifer now addressing GOP caucus. O'Brien standing behind her, facing Reps. — Josh Rogers (@joshrogersNHPR) December 3, 2014

NH house votes 222-157 to allow 15 minute recess called for by O'Brien for GOP caucus. — Josh Rogers (@joshrogersNHPR) December 3, 2014

Out of recess. O'Brien moves for 15 min GOP caucus. Jasper takes to floor: "We need to move on." — Josh Rogers (@joshrogersNHPR) December 3, 2014

NH House votes 199-182 to reopen nominations for Speaker. 15 min recess. — Josh Rogers (@joshrogersNHPR) December 3, 2014

#NHHouse voting on whether or not to re-open nominations for speaker following first vote. #NHPolitics http://t.co/UV7lsoUHuV — NH Public Radio (@nhpr) December 3, 2014

O'Brien backer Steve Stepanek R- Amherst, challenges ruling of house clerk, that blank ballots count as ballots cast. Things getting testy. — Josh Rogers (@joshrogersNHPR) December 3, 2014