A paperwork error resulted in a man being released early from the Salt Lake County Jail. Now, police believe that man tried to seek revenge against the person he thought put him behind bars in the first place.

On Sunday, the Deseret Morning News reported that two men attempted to rob a third man in a parking lot near 100 West and 7000 South. One of the would-be robbers was Luis Acosta Perez, said Midvale police Sgt. John Salazar.

Perez allegedly demanded the man's money and then his truck, Salazar said. When he said no, Perez allegedly pulled out a gun, Salazar said. The potential victim turned the tables on Perez, however, and took the gun away from him after a brief struggle.

The man shot Perez in the arm, and then shot him a second time in the torso when he continued to fight, Salazar said.

Investigators believe that incident was actually a retaliation attempt rather than just a random robbery.

In August, three armed men were caught on a store security camera robbing Joyous Lilana Jewelry in Salt Lake City. A tip from a witness eventually lead to the trio's arrest. Perez was one of those three men and was charged in 3rd District Court with aggravated robbery.

The man Perez attempted to rob this week "was actually the witness in the robbery in Salt Lake," Salazar said.

After spending just four days in jail, however, Perez was released because Salt Lake City police failed to file the proper paperwork to hold him.

"It was our fault," conceded Salt Lake City police detective Jeff Bedard. "We didn't get it served at the jail before he was scheduled to be released."

Bedard said the department was not going to offer an explanation of why the paperwork wasn't in filed in time, because that would only make it sound like they were giving excuses.

"We are taking responsibility and taking every measure we can to address this. From time to time, mistakes happen. We never like to see them happen, and we will try to do everything we can to make sure they don't happen again," Bedard said.

For the Midvale incident earlier this week, Perez was charged Wednesday in 3rd District Court with attempted aggravated murder and aggravated robbery, both first-degree felonies, and retaliation against a witness and aggravated assault, both third-degree felonies.

Perez remained at an undisclosed hospital Friday, with Midvale police standing guard outside his hospital room, Salazar said.

E-mail: preavy@desnews.com