A top manager at Blackwater Worldwide threatened to kill a State Department official who was investigating the private security company's operations in Iraq, just weeks before their guards killed 17 civilians at Baghdad's Nisour Square in 2007.

A New York Times report based on documents from the investigation found out that employees of the company, which had a contract worth more than $1bn (£587m) to protect American diplomats, were involved in several episodes of misconduct and negligence in Baghdad.

The official discovered that Blackwater staff were partying hard with women in their private rooms, where they held automatic weapons and ammunitions. The armoured vehicles used to defend American diplomats were "poorly maintained and deteriorating". One episode concerns four drunk guards who drove a heavily armoured vehicle worth $180,000 (£105,000) to a private party and crashed into a concrete barrier.

The investigations also ascertained that Blackwater was overbilling the State Department by manipulating its personnel records. A firm affiliated with Blackwater was forcing "third country nationals" from Pakistan and Yemen to live in sordid conditions - cramming three in a cramped room with no bed.

The company managed to get away with the inappropriate behaviour because embassy personnel got "too close" to the contractor, according to the investigation. In a memo dated 31 August 2007 to senior State Department officials in Washington, the investigator Jean C. Richter wrote that Blackwater's project manager Daniel Carroll said "that he could kill me at that very moment and no one could or would do anything about it as we were in Iraq".

"I took Mr. Carroll's threat seriously. We were in a combat zone where things can happen quite unexpectedly, especially when issues involve potentially negative impacts on a lucrative security contract," Richter said. The exchange was witnessed by Donald Thomas Jr, a State Department management analyst, who wrote that Carroll's comments were "unprofessional and threatening in nature".

Just a few weeks after the memo was written, four Blackwater guards were involved in Nisour Square massacre, which will become the single bloodiest incident involving American private security contractors during the Iraqi conflict.

The shooting took place on 16 September 2007 at the busy Nisour Square intersection. Seventeen civilians died, including nine-year-old Ali Kinani, and 20 were wounded after Blackwater staffers opened fire on the traffic. The guards claimed they had been fired upon first, but American military officials stated that there was no evidence of insurgent activity in the square. The Blackwater personnel had shot with automatic weapons, heavy machine guns and grenade launchers.

The incident strained relations between Baghdad and was a watershed in the American occupation of Iraq and influenced Iraq's refusal to agree to a treaty allowing the US troops to stay in the country beyond 2011.