MISSOULA, Mont. -

A Missoula man appeared in court Tuesday afternoon to face several charges stemming from a nearly 20-hour standoff.

Jason Kirchner is charged with four felonies, including Assault with a Weapon, Criminal Endangerment and Criminal Mischief. Officials tell NBC Montana those charges could change depending on their investigation.

In court Tuesday Deputy County Attorney Jason Marks told the judge Kirchner is a threat to the community.

“Given the violent nature of the offense and the long standoff in which he repeatedly fired at police officers, it’s our position that he represents a significant risk to the community,” says Marks.

According to court documents, officers first received a report of an assault around 7 a.m. Monday. When they arrived at Kirchner's apartment at 1700 Cooley in the northern part of the city, another man reported that Kirchner hit him in the face. The victim told police that he had gone to Kirchner's mobile home to attempt to calm him down. That man reported that Kirchner had been fighting with his girlfriend for several hours and had been involved in heavy drug use.

Officers tried to get Kirchner to answer the door but he did not respond, so they phoned him. That's when authorities say that Kirchner threatened officers and stated that "everyone within a thousand yards is dead." Kirchner then apparently hung up the phone and threw it out of the window of the mobile home.

Later that afternoon, officers reported that Kirchner fired off more than a dozen shots from a gun, striking an armored vehicle close to where officers had gathered.

Court records state that Kirchner later fired on a robot and another armored vehicle that had been brought down from Kalispell. The robot is believed to have sustained more than $1,500 worth of damage.

Kirchner finally surrendered around 4 a.m. Tuesday. The woman inside the home with him was unarmed, but she was arrested for outstanding warrants.

Kirchner is being held in the Missoula County Detention Center. His bail has been set at $100,000 and he will be back in court early next month. To read the complaint against Kirchner, click here.

For NBC Montana's report with more information on the allegations against Kirchner, click here.

---------------------

A standoff that lasted more than 20 hours ended peacefully early Tuesday morning.

The suspect who had been locked inside a trailer in the north end of Missoula surrendered around 3:30 a.m.

Missoula Police Lt. Richard Stepper said a woman who had been in the trailer came out first. Then the suspect came out, talked with police and went back inside for 30 minutes before surrendering.

The incident started Monday morning around 6:30 a.m. after the suspect allegedly got in a fight with another man, then locked himself in the trailer with the woman.

Law enforcement regrouped Monday afternoon, after a shot was fired from the trailer into a SWAT vehicle. No injuries were reported.

Richard said after multiple attempts to get the man to surrender, the suspect's mother assisted in the negotiations and the man gave up.

Police will investigate throughout the day Tuesday. It is unknown at this time whether the woman who was in the trailer was an accomplice or a hostage.  Police said she was living there.

Richard said police will also look at bullet holes that are in trailers nearby.