Few companies have borne the brunt of Sen. Elizabeth Warren’s (D-MA) campaign-trail wrath more than defense contractor Raytheon.

She teed off on its former top lobbyist during his bid to lead the Defense Department in July. And Warren’s campaign tells The Daily Beast that she opposes the company’s ongoing efforts to merge with aerospace giant United Technologies.

But Raytheon, which is headquartered in Waltham, Massachusetts, isn’t giving up on Warren quite yet, despite her populist broadsides against the company.

“Raytheon maintains positive working relationships with members of Congress who represent our employees across the country, including Senator Warren,” spokesman Mike Doble told The Daily Beast in an email.

Such anodyne language is fairly typical of companies looking to stay in the good graces of key legislators. But Raytheon has reason to remain hopeful. For years, Massachusetts’ sizable defense industry has cultivated its relationship with Warren, and the senator, in turn, has been willing to work with the industry even as she’s crafted a public image as an anti-corporate crusader.

“There’s certainly not an impression that she’s adversarial,” one Massachusetts defense executive told Politico for a 2015 story on her relationship with the industry.

Indeed, Warren, a member of the Armed Services Committee, hadn’t even taken office before she began building bridges with home-state Pentagon contractors, including Raytheon. In June 2012, months before her election to the Senate, Warren reached out to William Swanson, then the company’s chairman and chief executive. “It was a good, in-depth conversation,’’ a Warren aide told The Boston Globe at the time.

She also worked to build bridges with General Dynamics, another defense giant with major operations in the Bay State. That company called Warren a “crucial” ally in its huge lobbying campaign during her first year in the Senate to preserve funding for battlefield communications systems manufactured in part in Massachusetts.

Warren certainly hasn’t been Congress’ most strident defender of the defense industry, and she has authored legislation that is not in its immediate financial interests. In 2017, she sponsored a bill mandating new workplace safety requirements for federal contractors, a measure sure to impose new costs on firms reliant on Pentagon cash (the bill never made it out of committee). And Warren has generally opposed U.S. military interventions, including U.S. backing for and American arms sales to the Saudi offensive in Yemen, that would naturally redound to the benefit of the nation’s top defense contractors.

Warren’s campaign portrayed her recent hostility as a presidential candidate to the industry as perfectly in line with her legislative work. “Continuing her work in the Senate, Elizabeth will fight to end the intense coziness between defense contractors and the Pentagon as president,” campaign spokeswoman Saloni Sharma said in an emailed statement. “She has a plan to end the influence of defense contractors so we can start making deep cuts to our bloated defense budget.”

But when it comes to projects more specific to her own state, Warren has often operated like the traditional politicians she often decries. In 2017, Warren secured $138.5 million in pork for a handful of military projects in the state, including improvements to multiple Massachusetts bases and $45 million in new Army research funding. That funding, Warren hoped, would end up at advanced research facilities like Natick’s Army Soldier Systems Center.

Warren’s office bragged that she had “successfully fought to secure additional funding to support Massachusetts’ military objectives.”

Despite Warren’s efforts to bring home the bacon, employees at defense contractors have largely been reluctant to donate to her campaigns. The biggest base of industry donors came from Raytheon, one of the largest employers in Massachusetts. Employees there donated a little over $20,000 to support Warren’s two Senate campaigns, and Raytheon’s corporate PAC chipped in another $5,000 in 2014.

Warren’s presidential campaign has sworn off corporate PAC money entirely, but some individual Raytheon donors have continued to step up. Pamela Wickham, a Raytheon vice president and a board member of its U.K. subsidiary, has donated $1,750 to Warren’s presidential campaign, on top of the $5,700 she chipped in for Warren’s Senate runs.

Warren has raised tens of millions of dollars over the course of her career. And there is no indication that those specific contributions have affected her views. On the contrary: Once considered an ally of her home-state defense industry, Warren has turned Raytheon into a bogeyman this year, painting the company as emblematic of a corrupt military-industrial complex personified by Mark Esper, its former vice president of government relations and now the U.S. secretary of defense, with whom Warren sparred during his confirmation hearings in July and a prior confirmation fight during his 2017 nomination to be Secretary of the Army, which she also opposed.

Warren is also staking out opposition to Raytheon’s biggest, and most controversial, regulatory priority of the moment: its proposed United Technologies merger.

“Massive consolidation in the defense industry has stifled competition and innovation, raised costs, and increased corporate capture of the Pentagon,” her campaign told The Daily Beast. “This merger might make Raytheon’s shareholders richer, but it won’t benefit American workers, American taxpayers or American security.”

The marked shift in Warren’s attitude toward such a high-profile company illustrates another truism of presidential politics during a populist political moment. Once indulgent of parochial home-state industries, Warren has turned her fire on some of the same companies with which she once worked amiably.