After 23 terms, mostly in the House of Representatives he lorded over as speaker for an unprecedented 10 terms, the 71-year-old Martin lost on Tuesday to Republican Allen Nadeau of Fort Kent. Martin attributed his defeat to heavy spending by his adversaries on negative and sometimes false advertising. Some just blamed voter fatigue.

‘‘After a while, if you sling enough mud, some of it is going to stick,’’ said Martin, who reckons the campaign to defeat him cost $75,000. ‘‘I probably saved a few Democrats by having them spend all that money against me.’’

By almost anyone’s estimation, Martin is a master parliamentarian, a state budget expert who served on the Appropriations Committee, a superwonk on the minutiae of state government, and a skilled political gamesman.

Martin amassed much of his clout through his intelligence and knowledge of the process, said Paul Mills, a Farmington attorney and Maine political historian.

‘‘Knowledge is power,’’ said Mills.

Once a legislator, always a legislator

Martin left the impression he would remain familiar around the building in which he is an institution himself.

‘‘I don’t intend to stop working on issues I strongly believe in,’’ said Martin. ‘‘The last thing I want to see is the state in a mess.’’

His decades in the State House started when he was a wide-eyed 23-year-old from the remote northern Maine town of Eagle Lake. In the view of his many critics, he amassed too much power during the height of his prominence in the 1990s, a view that gave momentum to the popular initiative to impose term limits.

It is that law that led to the only hiatus in Martin’s legislative career, 1997-98. But he came back and later got around the law as other lawmakers do by simply switching chambers and being elected to the Senate.