During his tenure as the longest-serving speaker of the House in Massachusetts history, Thomas W. McGee made his gavel sound like a gun shot.

Though 5-foot-6, he was a former bantamweight boxer, and as a Marine had operated a tank during World War II. Mr. McGee ruled the House membership from 1975 until a palace revolt against his autocratic style cost him the speaker’s title in 1985 and sent him to a seat in back of the chamber where he first started his legislative career.

“Hey, I’m human. I’ve made mistakes. I won’t say I’ve never abused the power, but I’ve never done it intentionally,” the cigar-chomping Mr. McGee told the Globe in 1984 as he scrambled in vain to keep George Keverian, the House majority leader, from taking his job.

Mr. McGee, who was defeated in 1990 in a bid for a 15th term, died Dec. 21 in Kaplan Family Hospice House in Danvers of complications from Alzheimer’s disease. He was 88 and had lived in Swampscott.

After Mr. McGee, a Democrat and longtime Lynn resident, lost his ornate third-floor office, his staff, and the speaker’s pay boost, he told the Globe he wasn’t bitter.

“The odds were against me when I came here,” he said in November 1985. “Who ever thought I’d do as well as I did? It’s fantastic to aspire for something and to reach the heights I did.”

One of his sons, state Senator Thomas M. McGee, a Lynn Democrat, who was 19 when he watched his father first sworn in as speaker, said the portrait pundits drew of Mr. McGee as hot-tempered and tyrannical did not match the man he knew.

“His exterior was really tough,” Mr. McGee’s son said. “He would get angry, but in many ways he was just blowing off steam. If you took the next step, you would find out underneath it was a heart of gold and a person who wanted to help people.”

His son added that “the real guy was different than the person you saw in the paper. He was strong in what he believed in and he let you know that.”

A Lynn native, Mr. McGee dropped out of high school at 17 to join the Marines during World War II. He fought in the South Pacific with the Fourth Division, surviving battles at Saipan, Tinian, and Iwo Jima, where the majority of his comrades were killed.

“Every day after that for him was a gift,” said his daughter Colleen McGee Kavanaugh of Washington, D.C. “I think he really believed that, and he had a responsibility to those who had died. He always said they were the heroes.”

Thomas William McGee was the eldest child of Thomas A., who suffered the effects of gas poisoning while fighting in World War I, and the former Mary A. O’Shea, a factory worker who was the family’s breadwinner during the Great Depression and became a union organizer, his family said.

Mr. McGee was deeply influenced by his mother’s activism and devotion to winning fair wages, his family said.

“She was really special to him,” his daughter said.

After the war, he went to Boston University on the GI Bill and graduated with a law degree in 1953.

He failed the bar exam and years later, when he was middle-aged, took the test again, and still did not earn a passing score. He considered it the worst failing of his life, his family said.

He was married almost 30 years to his first wife, the former Ann Sorrenti, with whom he had four children, his family said. Their marriage ended in divorce.

First elected to the Lynn City Council in 1956, Mr. McGee often listened to his constituents over coffee at Bill’s Lunch, where he began honing a reputation as a fighter for the residents of the North Shore city.

“He touched a lot of people’s lives,” said Albert V. DiVirgilio, a friend since the late 1960s and a former mayor of Lynn. “Sometimes politicians can become self-important, but he was always a regular guy.”

The municipality was almost bankrupt when DiVirgilio became mayor in 1985 and reached out to Mr. McGee, who helped secure a loan from the state that helped put the city back on its feet.

“He was able to pull some strings and make things happen,” DiVirgilio said.

Mr. McGee also is remembered for maneuvering to make Lynn the site of North Shore Community College, which might have wound up in Beverly if not for Mr. McGee’s political clout, DiVirgilio recalled.

The college named a building after Mr. McGee.

“He was something. He was a great guy,” said A. Joseph DeNucci, a former longtime state auditor who credited Mr. McGee with helping launch his career by appointing him chairman of the House Human Services Committee.

“He was the end of a great era,” said DeNucci, who spent 10 years in the House. “He was the best and I mean that.”

When Mr. McGee was first elected to the House, he became the veritable platoon leader of a group of new legislators who called themselves the gang of seven, said Timothy Hickey, a former state representative.

“He was a loyal guy,” said Hickey, who left the House in 1972, but remained close to Mr. McGee and others from their State House class of 1963.

Hickey recalled playing golf about five years ago with Mr. McGee and former Red Sox great Jim Rice. Mr. McGee was losing his eyesight to macular degeneration.

“Tommy hit the ball and Jim Rice spotted it for him,” Hickey said.

For many years, Mr. McGee oversaw a golf tournament to benefit the McGee Substance Abuse Unit at Hillcrest Hospital in Pittsfield. As a state representative, Mr. McGee filed comprehensive alcoholism treatment legislation in the 1970s that called for better state-sponsored treatment programs.

Maintaining sobriety was a key pillar of his life, according to his family.

“My father would have been sober 49 years on Jan. 5,” said daughter Colleen. “He always said he would never have done the things he did in his life if he hadn’t found a way to sobriety.”

Mr. McGee was married 22 years to the former Grace Hogan, who was his former administrative assistant and gatekeeper when he was speaker.

In addition to his wife, son, and daughter, Mr. McGee leaves a sister, Mileen Schlenker of Marco Island, Fla.; two other sons, Shawn of Georgetown and Michael of Danvers; eight grandchildren; and six great-grandchildren.

A memorial Mass will be said at 11 a.m. Saturday in St. Mary’s Church in Lynn. Burial was private at Pine Grove Cemetery in Lynn.

“It’s like anything else in life. If I had to do it over, I would have done some things differently,” Mr. McGee told the Globe in 1985. “There are people who walk by me in the chamber and can’t look me in the eye. I can always get up in the morning and look at myself in the mirror. I always did what I thought was right.”

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.