The rapper Juelz Santana must get an anger management assessment before he can move back in with his girlfriend and their three children in Totowa, N.J., while he's under house arrest on gun charges.

Santana, whose legal name is LaRon James, has an electronic monitoring bracelet while he stays at his mother's house in Teaneck, N.J. Santana, 36, was arrested in March on charges he brought a loaded gun to Newark Liberty International Airport and fled when it was discovered in his suitcase.

On Monday, a federal judge said Santana would have to get the anger management assessment before he rules on whether to allow the move back to the home he shares with his girlfriend, according to U.S. Attorney's Office spokesperson Will Skaggs. Pretrial court officials have opposed the request, citing a previous domestic abuse incident involving James and his girlfriend.

Magistrate Michael M. Hammer in Newark also decided Monday that Santana may join his group, the Diplomats, also known as Dipset, during their tour around the country between July 22 and Aug. 18, Skaggs said. Last month, the magistrate allowed Santana to attend the first five concerts, in New Hampshire, Virginia, Maryland, and North Carolina, but so far Santana has skipped the performances.

The magistrate, however, continued to impose strict conditions, saying Santana could only join the concerts by car, and only while accompanied by his mother. He also continues to be barred from flying and from traveling or staying with his group.

In a letter his lawyer sent to the magistrate last month, Santana said he and his girlfriend were in couples therapy and were doing well, and that he wanted to be home with his family.

In an Instagram post uploaded on Sunday, Santana appeared to respond to reports by BET and other entertainment sites that the magistrate had ordered a mental health examination and, if necessary, treatment.

He wrote: "U Crazy For 4 Believing Every Thing U Hear."

Santana also has posted a picture of his electronic ankle bracelet on Instagram.  The magistrate ordered him to continue to wear it on tour and to also provide court officials and law enforcement with his itinerary before he departs.

Don Sh%t... 🔥💯✔️🙌

A post shared by thejuelzsantana (@thejuelzsantana) on

According to BET, Santana recently backed out of joining the Dipset tour, saying on social media that the "bag wasn't right."

Santana was arrested in March after a Transportation Security Administration agent spotted a .38-caliber Derringer pistol in his suitcase during X-ray screening at the airport's security gate, authorities said. He bolted from the airport and left in a taxi.

Three days later, he surrendered and was placed on house arrest, with his mother, Deborah James, acting as a third-party custodian.

After his arrest, the Electric Factory in Philadelphia canceled a Diplomats concert "due to unforeseen circumstances." He was also missing from the lineup during the 11th annual Roots Picnic at Festival Pier on June 2.

Authorities said the "There it Go" hit-maker has been prohibited from possessing a firearm since 2013, when he was convicted of manufacturing and distributing a controlled substance. He was charged with possession of a gun by a convicted felon and carrying a gun on an aircraft.

If convicted of the new charges, he faces a maximum of 20 years in prison.

Dipset recently released a new song, "Stronger," from the soundtrack for the upcoming movie Uncle Drew.