The first shots sailed past Iraqi police officers at a checkpoint. They took off in three squad cars, their lights flashing.

It was early in the Iraq war, Dec. 22, 2004, and it turned out that the shots came not from insurgents or criminals. They were fired by an American private security company named Custer Battles, according to an incident report in an archive of more than 300,000 classified military documents made public by WikiLeaks.

The company’s convoy sped south in Umm Qasr, a grubby port city near the Persian Gulf. It shot out the tire of a civilian car that came close. It fired five shots into a crowded minibus. The shooting stopped only after the Iraqi police, port security and a British military unit finally caught up with the convoy.

Somehow no one had been hurt, and the contractors found a quick way to prevent messy disciplinary action. They handed out cash to Iraqi civilians, and left.

The documents sketch, in vivid detail, a critical change in the way America wages war: the early days of the Iraq war, with all its Wild West chaos, ushered in the era of the private contractor, wearing no uniform but fighting and dying in battle, gathering and disseminating intelligence and killing presumed insurgents.

There have been many abuses, including civilian deaths, to the point that the Afghan government is working to ban many outside contractors entirely.

The use of security contractors is expected to grow as American forces shrink. A July report by the Commission on Wartime Contracting, a panel established by Congress, estimated that the State Department alone would need more than double the number of contractors it had protecting the American Embassy and consulates in Iraq.

Contractors were necessary at the start of the Iraq war because there simply were not enough soldiers to do the job. In 2004, their presence became the symbol for Iraq’s descent into chaos, when four contractors were killed in Falluja, their bodies left mangled and charred.

Even now — with many contractors discredited for unjustified shootings and a lack of accountability amply described in the documents — the military cannot do without them. There are more contractors over all than actual members of the military serving in the worsening war in Afghanistan.

The archive, which describes many episodes never made public in such detail, shows the multitude of shortcomings with this new system: how a failure to coordinate among contractors, coalition forces and Iraqi troops, as well as a failure to enforce rules of engagement that bind the military, endangered civilians as well as the contractors themselves. The military was often outright hostile to contractors, for being amateurish, overpaid and, often, trigger-happy.

Contractors often shot with little discrimination — and few if any consequences — at unarmed Iraqi civilians, Iraqi security forces, American troops and even other contractors, stirring public outrage and undermining much of what the coalition forces were sent to accomplish.

The mayhem cropped up around Iraq, notably in one episode reported in March 2005 in which a small battle erupted involving three separate security companies.

At a notoriously dangerous checkpoint on the main road to the Baghdad airport, a cement truck entered a lane reserved for Department of Defense vehicles. A guard from Global, a British company, fired a warning shot, and when a man initially identified as an Iraqi opened the door and tried to flee, guards from a tower started firing, too. The man dropped to the ground. Then members of an Iraqi private security team parked nearby also opened fire, shooting through the chest not the driver but a worker from DynCorp International, an American security company.

When the truck driver was finally questioned, he turned out to be a Filipino named José who worked with yet a third company, KBR, the American logistics and security giant.

The conclusion drawn from this chaos was, “IT IS BELIEVED THE DRIVER ENTERED THE DOD LANE BY ACCIDENT.”