Gov. Charlie Baker of Massachusetts, a moderate Republican who defied former President Donald J. Trump during his two terms, announced on Wednesday that he would not seek re-election next year.
“After several months of discussion with our families, we have decided not to seek re-election in 2022,” Mr. Baker and his lieutenant governor, Karyn Polito, wrote in a letter to supporters.
Mr. Baker, 65, who is more popular in polling among Democrats and independent voters than he is among fellow Republicans, confronted a Trump-backed primary challenge and a general election in which he could have faced the state’s popular attorney general, Maura Healey, a Democrat.
A former health care executive, Mr. Baker is a popular, even-keeled, nonideological New England Republican who has been a proponent of abortion rights, same-sex marriage and some gun control measures. He would have been the favorite had he decided to run. But he was also a relic of the pre-Trump Republican Party that now exists mostly in television green rooms and Washington think tanks.
Mr. Baker, along with Govs. Phil Scott of Vermont and Larry Hogan of Maryland, made up a cadre of northeastern Republicans who ran Democratic states during the Trump era. But while Mr. Hogan has toyed with running for national office as an anti-Trump Republican, Mr. Baker avoided commenting on Mr. Trump and rarely appeared on cable television.
He made no reference to Mr. Trump in the letter announcing his decision not to run again. But he did caution that a difficult re-election campaign would distract from the state’s efforts to fight the coronavirus pandemic.
“We want to focus on recovery, not on the grudge matches political campaigns can devolve into,” he wrote.
Mr. Baker’s departure from the race will make it a high-profile contest between different branches of the Democratic Party, most likely pitting Ms. Healey, of the establishment’s center left, against the progressives Sonia Chang-Díaz, a state senator, and Ben Downing, a former state senator.
Ms. Healey has yet to announce her candidacy but has said she would consider the race. Ms. Chang-Díaz and Mr. Downing have been campaigning for months.
Mr. Baker faced a difficult Republican primary challenge from Geoff Diehl, a former state representative who was chairman of Mr. Trump’s 2016 campaign in Massachusetts. Mr. Trump endorsed Mr. Diehl in October while denouncing Mr. Baker as a “Republican in name only.”
Mr. Diehl is far less likely than Mr. Baker to retain the Massachusetts governor’s office for Republicans. Mr. Trump is highly unpopular in the state, which backed Joseph R. Biden Jr. by 33 percentage points in 2020.
Ellen Barry contributed reporting.