WASHINGTON — Republicans, once solid backers of law enforcement, have turned against the FBI in the past year, suggesting that President Donald Trump’s attacks on the bureau and its leadership have had a significant impact.

By contrast, views of most other federal agencies have held steady or improved, according to a survey by the nonpartisan Pew Research Center, which periodically has asked Americans what they think about major parts of the federal government.

The public’s view of some agencies shows a partisan split, most notable with attitudes toward the federal Immigration and Customs Enforcement agency that some Democrats have recently campaigned to abolish.

For most of the past decade, however, the FBI’s image soared above the typical partisan divide. About 7 in 10 Americans, regardless of party, had a positive impression of the bureau.

That bipartisan consensus started to break down in 2016, likely reflecting the belief among many Republicans that the FBI was failing to pursue what Trump claimed were examples of wrongdoing by Hillary Clinton.

That small shift turned into a big one after Trump’s inauguration. In his first year, Trump fired FBI Director James Comey and repeatedly accused the bureau of participating in a “witch hunt” because of its probe into his campaign’s possible links to Russian interference in the 2016 election.

Since early 2017, backing for the FBI among people who identify themselves as Republicans or independents who lean toward the GOP has dropped 16 points. Republicans now divide about evenly in their views of the FBI, 49 percent favorable, 44 percent unfavorable, down from roughly 3-to-1 support a year ago.

Although many Democratic activists blame Comey’s actions for costing Clinton the election, favorable views of the FBI among Democrats and independents who lean Democratic has gone up slightly in the last two years. More than three-quarters of Democrats have a favorable view of the FBI.

The most favorable image among the agencies the poll asked about belongs to the National Park Service, which 83 percent view positively and only 7 percent negatively.

Partisans divide starkly over ICE, much as they do over immigration policy. Nearly 8 in 10 people who identify themselves as conservative Republicans view the agency favorably, while slightly more than 8 in 10 liberal Democrats view it unfavorably.

The Pew survey, conducted July 11-15 among 1,007 adults, has a margin of error of 3.7 percentage points in either direction.