Casper police on Tuesday arrested a man after he allegedly entered a trailer home in the 1200 block of Elma and shot at another man and attempted to shoot at police officers.

Jessie Contreas, 39,  was booked into jail on recommended charges of aggravated burglary, three counts of aggravated assault and possession of marijuana as a third or subsequent offense.  He is set to make his initial appearance in Natrona County Circuit Court at 2 p.m. Wednesday.

No one was hurt in the incident.

According to court papers, police dispatch received a 911 call shortly before 9:20 a.m. Tuesday. A man who lived in the trailer home said Contreas had entered the residence shouting about a woman. Contreas, who was carrying a black and silver 9mm handgun, fired one round at the man.

Police arrived at the scene, and Contreas tried to run off. As officers moved to apprehend him, Contreas spun to his left, pointing the gun at two officers in succession as his arm swung. Police say they watched him squeeze the trigger as he pointed the gun in their direction.

With their guns drawn, officers gave Contreas commands to drop the gun and give up. He eventually pointed the gun into the air, then slammed it to the ground and walked toward one officer, ignoring commands. That officer had to physically take Contreas to the ground in order to place him in custody.

Police found that the bullets in Contreas's magazine were "tumbled" -- meaning they had been inserted improperly, preventing them from being loaded into the chamber.

Through interviews, police later determined that Contreas's girlfriend had left him and was staying at the trailer house with her previous longtime boyfriend.

That woman told police that Contreas used methamphetamine and would periodically beat her. She would leave him, but then Contreas would make her feel bad for him, and she would return.

When Contreas entered the residence with the gun on Tuesday, he allegedly made remarks to the effect that he intended to kill the woman, and she had left him for the last time.

In an interview with police, Contreas allegedly denied trying to pull the trigger when the gun was pointed at officers. Later, Contreas said his finger had moved when he activated the safety catch on the gun. However, police noted that the gun -- a Springfield semiautomatic -- had no safety switch.