YAKIMA, Wash. — “Crazy Thug” went back to prison Monday, this time for 10 years.

The 24-year-old gang member, whose real name is Rigoberto E. Gonzalez, hasn’t been able to stay out of trouble following his release from prison 22 months ago for a 2005 shooting outside the east Yakima Wal-Mart.

During a fateful one-year stretch, he got picked up no fewer than three times on gun and drug charges. The first two times he made bail. The third time he stayed in jail.

On Monday, Gonzalez pleaded guilty in Yakima County Superior Court to two felony firearm charges and two drug charges, and was sentenced to the statutory maximum of 10 years in prison.

“For this type of case, it’s not bad,” said deputy prosecutor Troy Clements, noting that federal authorities took over Gonzalez’s third arrest for possession of an AK-47-style rifle.

That case is still pending in U.S. District Court.

A member of the La Raza Norteño, Gonzalez’s string of arrests exposed shortcomings in communications and bail-setting calculations between prosecutors, the courts and the police.

It started in August 2011 after he finished a 75-month sentence for wounding a gang rival near the entrance of the east Yakima Wal-Mart in 2005.

Within months, he had been linked to several incidents.

His first post-prison arrest came on Jan. 13, 2012, when a traffic stop on Fruitvale Boulevard near 16th Avenue led to the discovery of a loaded .380-caliber semiautomatic pistol in his car.

A judge initially ordered him held on $100,000 bail, but after 41/2 months in jail he was released on a reduced bond of $75,000.

With that case still pending, he was picked up on another gun charge in December 2012 stemming from a raid at a restaurant on Ranchrite Road near Nob Hill Boulevard.

Police arrested several Norteños during the raid, including Gonzalez, who was found hiding in a storeroom in the basement.

A .45-caliber semiautomatic pistol was found under a nearby mop bucket, along with a plastic bag containing methamphetamine.

Prosecutors filed another gun charge as well as a drug-dealing charge.

However, despite his record and the fact that he was already out on bail on another gun charge, his bail was set at only $20,000.

He soon bailed out again, leading to his third arrest days later in connection with a traffic stop near the am/pm minimart on North First Street.

During the stop, an officer spied the handle of a firearm sticking out from underneath some clothing in the back seat of Gonzalez’s car.

A search warrant was obtained, leading to the seizure of a semiautomatic version of an AK-47 assault rifle.

County prosecutors initially filed yet another gun charge, but with their blessing federal prosecutors stepped in the third time, securing a grand jury indictment on a felon-in-possession charge.

That case was placed on hold while Gonzalez’s first two cases in Yakima County Superior Court were active.