During the Red Sox' victory over the Yankees Tuesday evening, former President Donald Trump threw a curveball into the nascent Republican primary for governor by endorsing former state Rep. Geoff Diehl, slamming Gov. Charlie Baker in the process.

In his endorsement of Diehl (R - Whitman), a longtime supporter of the former president, Trump described Baker as a "RINO" (Republican in Name Only) and criticized the governor's record. Baker has not yet announced whether he will seek a third term.

"Baker is definitely not an American First or Make America Great Again kind of guy," Trump wrote in a statement from his Save America organization.

"Geoff Diehl, on the other hand, is a true patriot, a believer in low energy costs and our independent energy policy," Trump wrote.

In his statement, Trump claimed that Massachusetts energy costs are "by far, the highest in the Nation," and blamed Baker's policies encouraging renewable energy development for the high costs. The U.S. Energy Information Administration lists Massachusetts as the fifth most expensive state for retail electricity, behind Hawaii, Alaska, Connecticut and Rhode Island.

"His 'green climate' views are fresh out of the AOC playbook," Trump wrote, referring to liberal New York Congresswoman Alexandria Ocasio-Cortez, who, along with Massachusetts U.S. Senator Ed Markey, authored the Green New Deal climate and energy plan.

In his own press release, Diehl wrote that "like the President, I want people to feel like government isn’t working against them and that they can enjoy the individual freedoms our state and country were founded upon.”

Asked about Trump's endorsement of Diehl at an event in Salem Wednesday, Baker did not say much about Trump's statement.

"I guess in some respects, I'm not surprised for a whole bunch of reasons," Baker said, before pivoting to his goals around getting people back to work and to school amid the COVID-19 pandemic.

Trump claimed that Baker "has seen crime go to record levels," though the violent crime rate in Massachusetts has been declining for years and decreased 16.2% since Baker took office in 2015, according to FBI data.

MassINC Polling Group president Steve Koczela told GBH News that Diehl, who lost to U.S. Sen. Elizabeth Warren in 2018 by more than 28 percentage points, could spell trouble for Baker should the incumbent governor choose to run again.

"Diehl's challenge will be that he needs to make a race of it," Koczela said. "He needs to get people to pay attention because his challenge has really been that a large swath of the electorate just wasn't that familiar with him. But among Republicans that were, his numbers have been very strong."

Koczela said that, while a boost from Trump could help launch Diehl's primary campaign, support from the former president — who is deeply unpopular in Massachusetts — would likely damage his chance of defeating any Democratic challenger in November 2022.

"If [Diehl] does win the primary, his odds in a general will be extremely long and his odds will be made worse by an endorsement from Donald Trump," Koczela said.

The moderate Baker has been feuding with the Trump-dominated state Republican party for much of his time in office. Still, Koczela says, Baker will need at least some support from the Trump wing of his party to succeed, since both Diehl and Trump easily won their respective primaries in Massachusetts against more moderate challengers.

"Just looking at the numbers of voters in the Republican primary that like Donald Trump, you can't win without appealing to a large number of those," Koczela said.

Asked about whether he will run for a third term Wednesday, Baker said he and his wife have been discussing what to do "the next time."

"My decision to run for office was and will be very personal, and it's got nothing to do with anything else. If I think I can continue to deliver for the people of the Commonwealth of Massachusetts that's going to play a big role in the decision that we make," Baker said.

Trump wrote that Baker "totally botched the Vaccination rollout," referring to the state's failed vaccine locator website and limited supply of vaccine earlier this year. Massachusetts is now second to Vermont as the most vaccinated state in the country.

Other areas where Trump attacked Baker were on his management of the MBTA and veterans' issues, which have both plagued Baker's administration over the years.

Koczela thinks Trump could continue to play a role in the Massachusetts race as the primary contest develops.

"We don't really know how into this race Donald Trump is really going to be," Koczela said. "This might be the last we hear of him, or he might really take this as one of his causes."