WASHINGTON — An official at the United States Embassy in Iraq has told federal prosecutors that he believes that State Department officials sought to block any serious investigation of the 2007 shooting episode in which Blackwater Worldwide security guards were accused of murdering 17 Iraqi civilians, according to court testimony made public on Tuesday.

David Farrington, a State Department security agent in the American Embassy at the time of the shooting in Baghdad’s Nisour Square, told prosecutors that some of his colleagues were handling evidence in a way they hoped would help the Blackwater guards avoid punishment for a crime that drew headlines and raised tensions between American and Iraqi officials.

The description of Mr. Farrington’s account came in closed-door testimony last October from Kenneth Kohl, the lead prosecutor in the case against the Blackwater guards.

“I talked to David Farrington, who was concerned, who expressed concern about the integrity of the work being done by his fellow officers,” Mr. Kohl recalled. He said that Mr. Farrington had said he was in meetings where diplomatic security agents said that after they had gone to the scene and picked up casings and other evidence, “They said we’ve got enough to get these guys off now.”