Nicholas A. Mattiello, a lawyer, House majority leader and Harley-Davidson aficionado, was elected House speaker on Tuesday, only days after an unexplained state and federal police raid precipitated the abrupt resignation of his predecessor, Gordon D. Fox.

A state lawmaker since 2007, Democrat Mattiello, 50, trounced his opponent, Michael J. Marcello, D-Scituate, on a 61-to-6 roll-call vote, with six abstentions and two absent, including Fox.

The vote capped a fast-paced, five-day campaign that Marcello tried to frame as a choice between sorely-needed government reforms and the status quo.

While Marcello talked about eliminating the “master lever,” ethics reform and the need to cap high-interest “payday” loans, Mattiello talked about “jobs and the economy.”

In the end, it was Mattiello’s message that prevailed among moderate-to-conservative Democrats — and Republicans — worried about the direction that Marcello’s left-leaning backers might take the state.

“Mike Marcello is probably my best friend in the building,” said House Minority Leader Brian Newberry, R-North Smithfield, “so it’s not about personality … . I would have been happy to vote to see him to be speaker.

“But his coalition was, in large part, based with the progressive left, which is sort of an anathema to most of what we stand for,” Newberry said.