BISMARCK, N.D. (AP) — North Dakota law enforcement purchased more than $600,000 worth of body armor, tactical equipment and crowd control devices during the height of protests against the Dakota Access oil pipeline, state invoices show.

The purchases, tallied by The Associated Press from invoices obtained through a public records request, included pepper spray, flash-bang and smoke grenades, riot helmets, gas masks, night-vision goggles, more than 2,000 rounds of non-lethal ammunition and more.

The equipment ultimately made up a small share of the $35 million in policing costs associated with the pipeline, and state officials defend the purchases as reasonable for a protest that attracted thousands of “water protectors” to southern North Dakota who skirmished — sometimes violently — with law enforcement.

“There was a legitimate, deliberate plan that was put together that said, ‘OK, how can we do this and do it safe for folks on both sides?’” state Homeland Security Director Greg Wilz said. “At the end of the day we were successful.”

Most of the purchases were in September, October and November of last year, when confrontations near a protest encampment grew most heated. Authorities established their own operations center a short distance away and manned it for months, making 761 arrests. About 75 officers were deployed on a typical day, though the number jumped to as many as 540 during one skirmish.

Invoices show Minneapolis-based police equipment company Streicher’s was paid nearly $613,000 for gear.

Protesters who have filed an excessive force lawsuit say police became “militarized” by October of last year and point to the use of such equipment, including tear gas, rubber bullets and concussion grenades. They allege a wide range of injuries, including burns, broken bones, eye injuries, and wounds requiring stitches and staples. Among those injured was Sophia Wilansky, a 21-year-old New York woman who underwent several surgeries for a serious arm injury. Protesters maintain she was injured by a grenade thrown by police, while authorities say she was hurt by a small propane tank that protesters rigged to explode.

“Having police officers show up looking like Stormtroopers, seems in many ways only exacerbated clashes that did occur,” said Lauren Regan, founder and executive director of the Civil Liberties Defense Center, which is part of the lawsuit. “When police officers anonymize themselves, when they put on all that Rambo gear and face shields and no one can identify them, it tends to incite that mob mentality.”

Police say officers were subjected to thrown objects and in one instance gunshots, though they did not report any serious injuries.

Two experts on policing — Michigan State University Intelligence Program Director David Carter and John Jay College of Criminal Justice professor Eugene O’Donnell — both said the purchases seemed reasonable.

″(Police) may not have the ready availability of massive numbers of people and resources, so there may be more of a need to go over the top in being ready just because of the geographical factor,” O’Donnell said.

Wilz, the state homeland security director, said North Dakota found no model for responding to such a large protest in a rural area, received no help from federal law agencies and basically came up with its own plan.

Authorities feared guns were in the protest camp based on social media postings, and area stores had alerted police that protesters were buying products such as wasp spray to use against officers, he said.

“That’s why the helmets and the shields and the protection came out,” he said. The heavily armed police force “did look like an escalation,” he acknowledged, “but largely it was there to protect the officers who were trying to protect the general public on all sides of this issue.”

The equipment wasn’t shared with private pipeline security in the protest area, Wilz said. All of it has been stored at state facilities for future use, he said.

The state also spent $12,350 on a subscription to Geofeedia, which collects, maps and stores information from social media posts. Police around the U.S. have used it to aid surveillance during protests, but it has drawn criticism from civil liberties groups. Facebook, Instagram and Twitter all have restricted access to Geofeedia in the past year under pressure from the American Civil Liberties Union.

Bills for protest-related expenses are still coming in. Much of the $35 million went to payroll, but restaurants, hotels and supply businesses in the Bismarck area received millions for services and product sales.

All of the spending will be audited by the state at some point, according to Secretary of State Al Jaeger and state Senate Appropriations Committee Chairman Ray Holmberg, two members of the state’s Emergency Commission, which approved borrowing money to cover the protest policing costs.

At least $10 million of the expense is being funded by taxpayers. Texas-based pipeline developer Energy Transfer Partners has given North Dakota $15 million to help with the bills. The state also has received a $10 million grant from the U.S. Justice Department for the same purpose.