THE Associated Press has a well-earned reputation as an independent, credible government watchdog. That’s why the Federal Bureau of Investigation’s appropriation of that credibility in a 2007 case obliterated a line that should never have been crossed.

The laudable end — conviction of a student making school bomb threats — does not justify the government’s outrageous disregard of the role of the press in a free society. In fact, it utterly undermines that role at a time when media companies are struggling to remain strong in the face of government abuses over the last two presidential administrations.

On Monday, Seattle Times reporter Mike Carter reported that, in 2007, the FBI mocked up a fake Associated Press story. The intention was to trick a suspect in a series of bomb threats at Lacey’s Timberline High School to click on a link sent to his MySpace account. All this was done under the authority of a federal warrant.

When the suspect clicked on the link, hidden FBI software revealed the suspect’s location to agents.

Initially, Carter found documents suggesting the FBI had nestled the AP story in an email that looked like it was from a Seattle Times’ website. But FBI officials waited almost a full day after Carter’s story was published Monday evening to suggest that, while using The Times name was contemplated and mocked up, the link to the AP story was not sent using a Times email.

The bomb-threat case was serious, no question, and deserved vigorous enforcement efforts. But agents could have tricked the student in other ways — a free concert ticket or free video game. They should not have assumed the identity of a media organization.

When the credibility of one media organization is exploited in this way, it hurts all of them. The Times is a member of The Associated Press and publishes many AP articles.

Also disturbing is how FBI officials responded to Times and AP criticism — with little more than a shrug. “We identified a specific subject of an investigation and used a technique that we deemed would be effective in preventing a possible act of violence in a school setting,” said Frank Montoya Jr., special agent in charge of the FBI’s Seattle office.

Here are questions for Montoya, and FBI Director James Comey:

• How often do agents appropriate media company identities?

• When will they stop?

The credibility of the press matters now more than ever. This 2007 investigation occurred under President George W. Bush’s administration, but the Obama administration is racking up an unprecedented record of hostility toward the press, open government and transparency. That ranges from limiting press access of White House photographers to seizing AP phone records to threatening to send a New York Times Pulitzer Prize-winning reporter to prison for protecting a source.

The FBI’s actions in this case undermined the credibility of press organizations who hold government accountable — and that matters.