VALENTINE, Neb. — A 36-year-old homeless man has been sentenced to nine to 18 years in prison for threatening another man with a gun at a Valentine bar.

Victor Ortega pleaded guilty to two felony charges, terroristic threats and possession of a deadly weapon by a prohibited person, under a plea agreement. In exchange, a third felony charge of using a firearm to commit a felony was dismissed.

According to an affidavit, police were called to The Corner Pub just after 7 p.m. Sept. 18 following a report that a man was pointing a weapon at customers.

When officers arrived, they found Ortega behind the bar taking alcoholic beverages from a refrigerator without permission from staff, the affidavit states.

Officers gave verbal commands that Ortega initially ignored, telling police, “I’m an outlaw. No, f--- that s---.” When an officer drew a Taser, Ortega began to comply but continued to resist while being handcuffed, according to the affidavit.

As officers escorted him out of the bar, Ortega spat in a man’s face and told police, “I was about to kill someone tonight,” the affidavit states.

Witnesses told officers Ortega had pulled a gun on another man during an argument. The victim said the confrontation began after Ortega believed he was part of a motorcycle gang, which upset him. Ortega also told the victim he was on the run from the cartel, according to the affidavit.

When the victim said police were on the way, Ortega allegedly dropped the gun, removed the magazine and placed it on the counter. A witness told officers Ortega then placed a second magazine on the counter before the witness took the gun and cleared it.