The Associated Press

BOSTON (AP) — Thomas Menino, whose folksy manner and verbal gaffes belied his shrewd political tactics and effective use of technology to govern as Boston’s longest-serving mayor and one of its most beloved, died Thursday. He was 71.

Spokeswoman Dot Joyce said in a statement that Menino died in the company of his family and friends. He was diagnosed with advanced cancer in February 2014, shortly after leaving office, and announced Oct. 23 he was suspending treatment and a book tour so he could spend more time with family and friends.

Menino was first elected in 1993 and built a formidable political machine that ended decades of Irish domination of city politics, at least temporarily. He won re-election four times. He was the city’s first Italian-American mayor and served in the office for more than 20 years before a series of health problems forced him, reluctantly, to eschew a bid for a sixth term.

“I can run, I can win and I can lead, but not in the neighborhoods all the time as I like,” Menino, a Democrat, told an overflow crowd at Boston’s historic Faneuil Hall on March 28, 2013.

Less than three weeks after that announcement, two bombs exploded at the finish line of the Boston Marathon, killing three people and injuring more than 260. Menino, who had undergone surgery on a broken leg just two days earlier, checked himself out of a hospital to help lead his shaken city through the crisis.

At an interfaith service three days after the bombings, Menino, in a symbolic act of personal defiance, painfully pulled himself to his feet from his wheelchair to declare that no act of violence could break Boston’s spirit.

“Even with the smell of smoke in the air and blood in the streets and tears in our eyes, we triumphed over that hateful act,” he said.

He was in an SUV in nearby Watertown at the end of a nearly daylong, violent manhunt when Police Commissioner Edward Davis informed him that the surviving bombing suspect had been captured. Menino’s tweet: “We got him.”

Menino was anything but a smooth public speaker and was prone to verbal gaffes. He was widely quoted describing Boston’s notorious parking shortage as “an Alcatraz” around his neck, rather than an albatross.

He often mangled or mixed up the names of Boston sports heroes — once famously confusing former New England Patriots kicker and Super Bowl hero Adam Vinatieri with ex-Red Sox catcher Jason Varitek. But while such mistakes might sink other politicians in a sports-crazed city, they only seemed to reinforce his affable personality and ability to connect with the residents he served.

“I’m Tom Menino. I’m not a fancy talker, but I get things done,” he said in his first TV ad.

He would grow a reputation as an urban mechanic, crisscrossing city neighborhoods and building coalitions to tackle problems as small as filling potholes or as big as rejuvenating the city’s public schools in the aftermath of court-ordered desegregation decades earlier.

In an interview with The Associated Press in March, Menino said he “loved every minute” of being mayor, even during the city’s darkest days. He credited his staff and others, downplaying his own role.

“I just did my job — nothing special,” he said.

His tireless public schedule amazed and exhausted many of his closest aides. In his new memoir, “Mayor For A New America,” he made clear that was his greatest legacy.

“I paid attention to the fundamentals of urban life — clean streets, public safety, good schools, neighborhood commerce,” Menino wrote in the memoir, released in October 2014 by Houghton Mifflin Harcourt. “Call my City Hall and you never got an answering machine. People trusted government because it heard them. Because they could talk to it. Because it kept its word.”

Menino was sometimes faulted for being too controlling or too quick to lose his temper with subordinates. But his lengthy administration would steer clear of major scandal, something that could not be said for many of his predecessors.

Thomas Michael Menino was born on Dec. 27, 1942, in the city’s Hyde Park neighborhood. He received a certificate in business administration from Chamberlayne Junior College in 1963. A former insurance salesman, he caught the political bug while working as a legislative aide to state Sen. Joseph Timilty. He first earned elective office as a district city councilor in 1984.

He went back to school and earned his undergraduate degree in community planning from the University of Massachusetts-Boston in 1988.

Menino became the council’s president in 1993 and was automatically elevated to mayor when then-mayor Raymond Flynn was named U.S. ambassador to the Vatican. While that prompted some to initially chide Menino as an ‘accidental mayor,’ he quickly proved his own political mettle, winning a four-year term later that year.

He was never seriously challenged in four subsequent re-election bids, a two-decade period in which the city he governed slowly grew younger and more diverse.

Traditional urban ethnic enclaves in Boston were beginning to give way to a mix of new immigrants and younger professionals. He developed vibrant neighborhoods through a series of initiatives: building and renovating public parks and green spaces, setting asides miles of new bicycle lanes despite the city’s famously narrow, twisting streets and promoting the public’s involvement in securing their communities and curbing violent crime.

Menino was also among the first big-city mayors to see the opportunities that technology afforded local governments to help solve recurring problems. He set up an office that developed a pioneering smartphone app for residents to report potholes and other apps to report graffiti and other nuisances.

He never sought nor showed interest in running for higher office. Mayor, it seemed, was the only political job to which he aspired. That would not, however, stop him from being at the forefront of major national issues.

He vigorously pushed to end gun violence as co-founder in 2006, with New York Mayor Michael Bloomberg, of a 700-member mayors’ group that lobbies lawmakers on gun measures.

Menino was among the first U.S. mayors to offer domestic partnership benefits to city employees when he signed an executive order in 1998, and he vowed block Chick-fil-A from opening a restaurant in the city after the company’s president spoke out against gay marriage in 2012, though he eventually acknowledged he had little power to stop the chain.

Menino was not afraid to experiment and walk away from what did not work.

In 1995, his administration began videotaping the court appearances of men arrested for soliciting prostitutes, promising to show on its cable TV station the arraignments of those convicted. Menino had earlier said, “By broadcasting faces on television at least some of the prostitution activity will decrease.”

The initiative was later abandoned.

Menino’s health was often a concern, and he was admitted to the hospital several times while in office.

In 2003, he underwent surgery to remove a rare sarcoma on his back. The following year, his doctors confirmed he has been diagnosed with Crohn’s disease, a type of inflammatory bowel disease.

He spent six weeks in the hospital in 2012 for a series of ailments, including a respiratory infection. While he was in the hospital, he suffered a compression fracture in his spine and was diagnosed with Type 2 diabetes.

In May 2013, he was back in the hospital for surgery for an enlarged prostate. In typical fashion, he declared on his release several days later that he would not let the latest ailment slow him down.

“I’m raring to go,” he said.

Menino focused much of his attention in his final months in office focusing on education, including an appearance before a legislative committee in which he advocated for more charter schools and flexibility to intervene in struggling urban schools.

Menino didn’t take sides in the race to succeed him, eventually won in November 2013 by Martin Walsh, a state representative from the Dorchester neighborhood. He instructed his staff to work closely with Walsh on a smooth transition of power.

Walsh paid tribute to his predecessor in his inaugural address the following January, saying Menino’s “legacy is already legend and his vision is all around us.”

Menino left City Hall on his final day in office Jan. 6 to thunderous applause from city workers. Later, he tweeted: “Thank you Boston. It has been the honor and thrill of a lifetime to be your Mayor. Be as good to each other as you have been to me.”

Menino accepted a position as co-director of Boston University’s new Initiative on Cities, a program that studies issues facing the future of the world’s cities.

In March 2014, Menino revealed in an interview with The Boston Globe he was battling an advanced form of cancer that had spread to his liver and lymph nodes. Doctors said they were unable to pinpoint where the cancer originated.

Menino told the newspaper he was ready to face the challenge.

“What I don’t want is people feeling sorry for me. I don’t want sympathy. There are people worse off than me. It’s my biggest concern — I don’t want to be treated any differently,” he said.

In a statement announcing he was stopping treatment to devote himself to his loved ones, Menino said he was “hopeful and optimistic that one day the talented researchers, doctors and medical professionals in this city will find a cure for this awful disease.”

Menino leaves behind his wife Angela, his children Susan and Thomas Jr., a Boston police officer, and six grandchildren.