STATE HOUSE, BOSTON, SEPT. 4, 2014….Gov. Deval Patrick, attempting to flex his political muscles in the close Democratic primary race for attorney general, turned heads on Thursday when he threw his support to Warren Tolman, saying he is excited about the potential for an “activist” attorney general.

Patrick said his faith in Tolman, who is locked in a tough battle for the party’s nomination with former assistant attorney general Maura Healey, stemmed in part from their relationship over the years.

“I am endorsing Warren because I know from his campaign and from a deep personal relationship with him that he will be an activist AG, and I am excited about that,” Patrick said in a statement released by Tolman’s campaign. “From gun safety to health care costs to consumer protection and civil rights, I want an AG who will not only enforce the law effectively, but also use the influence of the office strategically to improve the lives and prospects of Massachusetts people and small businesses. Warren Tolman will be that kind of leader.”

Healey, in a statement after Patrick’s endorsement, said she didn’t expect the backing of “the Beacon Hill establishment.” She said, “I get that my opponent is from that world and sometimes the Beacon Hill club doesn’t like when an upstart comes along, galvanizes the grassroots and threatens their chosen candidate. I also know I’ve taken some stances that upset the insiders, like casinos, which my opponent and his backers all desperately want.”

During an early afternoon radio appearance, Patrick said he would not endorse in the Democratic primary for governor between Don Berwick, Martha Coakley and Steven Grossman. The governor also declined to commit to saying which of the three candidates he will vote for, saying he “might” say after Tuesday.

On the radio, WGBH host Jim Braude noted similarities between Healey and Patrick, who first won the governorship in 2006 after working as a corporate attorney and in the civil rights division of the U.S. Department of Justice. Patrick had kind words for Healey. “I think both of these candidates are so good and have so much to contribute in terms of experience, and vision and skills and character,” he said.

Patrick said he has known Tolman for 20 years, and suggested the former state senator and his team were “relentless” in pursuing the governor for his endorsement.

“He played a very special role in my own re-election campaign in 2010 both before the cameras and behind the cameras and mostly behind the cameras and it’s something I feel very connected to him about and he and his team were relentless,” Patrick said.

Several of Patrick’s former top staffers, including Doug Rubin and Kyle Sullivan, work for Northwind Strategies, the political consulting firm advising Tolman’s campaign. Democratic strategist John Walsh, who managed Patrick’s 2006 campaign for governor, is a top Tolman supporter.

The Tolman-Healey race is one of the mostly closely watched races among statewide primaries. Republican John Miller, a lawyer from Winchester, will face the winner in November.

Tolman said he was grateful for the endorsement. “Governor Patrick has left a mark on Massachusetts as a bold and progressive leader, and a friend to the Commonwealth. I’m proud to have his support, and as Attorney General, I will share his values in fighting the tough fights and protecting our neighborhoods and communities,” Tolman said in a statement.

Healey said Thursday during an interview on Boston Herald Radio that she knew when she entered the race she would not have the support of Beacon Hill politicians.

“I got into this race knowing, shocker, that I wasn’t going to have the support of the political establishment. I wasn’t going to have the support of Beacon Hill, right,” Healey said.

She later added, “I feel like Beacon Hill, and Beacon Hill politicians and the establishment have their candidate, and the people of Massachusetts have theirs.”

Tolman, declined to appear on the radio show, according to hosts Hillary Chabot and Jaclyn Cashman. Chris Joyce, Tolman’s campaign manager, said the two Democrats had 18 debates and forums, including one held Wednesday night. “Our focus right now is on implementing our grassroots get-out-the-vote operation,” Joyce said in an email.

Healey and Tolman clashed last month during a feisty debate held by the Boston Globe. Tolman’s characterization of Healey’s question as “unbecoming” sparked criticism of him and an apology from Tolman.

During that Globe debate, the two candidates were asked whether they would take a pledge not to run for higher office if they win the attorney general’s office. Healey declined, but Tolman said, “In four years? Absolutely.”

On the radio Thursday, Healey said she does not view the AG’s office as a stepping stone to another political office, l offng stone to e AG’ot have the support of Beacon Hill politicans.t she knew going into teh our years.