BISMARCK, N.D. — A Denver woman accused of shooting at officers during protests in North Dakota against the Dakota Access oil pipeline was sentenced Wednesday to four years and nine months in federal prison.

Red Fawn Fallis, 39, was accused of firing a handgun three times while resisting arrest on Oct. 27, 2016. No one was hurt. Fallis, a member of the Oglala Sioux tribe, denied intentionally trying to injure anyone and claimed not to remember firing the gun after being tackled by police.

She pleaded guilty Jan. 22 to civil disorder and illegal possession of a gun by a convicted felon. She has a 2003 conviction in Colorado for being an accessory to a felony crime. Court records show she was accused of driving a car for a man who shot and wounded another man.

Prosecutors in the pipeline case agreed to drop a count of discharge of a firearm during a felony crime of violence and to recommend a sentence of no more than seven years in prison, though U.S. District Judge Daniel Hovland could have gone as high as 15 years. He could have gone up to 25 years had the third charge not been dropped. The defense asked for no more than 2 ½ years.

Hovland handed down his sentence at the conclusion of a 5 ½-hour hearing in a courtroom filled with dozens of Fallis’ supporters.

“This is a very serious case that could have escalated into something far worse,” Hovland said, adding that it could have become a “chaotic shootout.”

Attorneys for both sides had no immediate comment on whether they would appeal.

Fallis appeared at her sentencing wearing what she has described as “culturally appropriate clothing” that reflects her pride in her Native American heritage. Hovland earlier granted her request to not have to wear jail clothing.

Fallis spoke for several minutes when the judge allowed her to comment, saying she regrets what happened and is using it as an impetus to turn around her troubled life.

“I made poor choices once again and it hindered my decision-making,” she said, adding later that, “I’m sorry for what the officers had to go through because of my choices.”

Before being escorted from the courtroom she turned to her family members, thanking them for their support and telling them she loved them.

Debate during the hearing centered on whether Fallis intentionally fired at officers, and how much her troubled childhood and history of abusive adult relationships contributed to her frame of mind.

A psychologist called by the defense testified Fallis suffered from post-traumatic stress disorder, and a physiology professor said she might have involuntarily fired the gun without even being aware of it.

Assistant U.S. Attorney David Hagler questioned the assertions.

Judge Hovland concluded that “nobody knows what the real purpose was” of Fallis firing the gun but that “at a minimum (she) committed a menacing-type assault on the officers.”

Fallis’ attorneys said the decision not to take the case to trial was based on anti-protester sentiment in the area and unsuccessful attempts to have Hovland order the prosecution to turn over more information, including details about an FBI informant Fallis alleges seduced her and owned the gun.

The government maintained in court documents that it turned over all information about the informant and that “defendants’ reference to the FBI informant as some sort of complex issue is misplaced.”

Fallis’ arrest was one of 761 that authorities made in southern North Dakota during the height of protests in 2016 and 2017. At times thousands of pipeline opponents gathered in the region to protest the $3.8 billion project to move North Dakota oil to Illinois, but the effort didn’t stop the project.

The pipeline has been operating for a year. Opponents fear environmental harm, and four Native American tribes in the Dakotas are still fighting it in court. Texas-based developer Energy Transfer Partners says it’s safe.