EXCLUSIVE

4:23 PM PT -- This is a little complicated, but here's why 21 Savage's lawyer applied for a U-Visa 4 years ago. The application was submitted just after a judge vacated his drug conviction, and they felt they were eligible for legal status. That application fell into an abyss -- it was neither approved nor rejected. So in 2017, 21 Savage reapplied for a U-Visa and it has been pending ever since.

What's more ... there is solid law suggesting ICE had to release the rapper on bond, rather than keep him in custody.

Jay-Z is coming to the defense of 21 Savage, slamming his arrest by ICE and throwing some major support his way ... including help with his upcoming legal battle.

The hip-hop mogul calls the arrest and detention of the "Bank Account" rapper "an absolute travesty" ... and points out his U Visa application has been pending for years.

Jay says ... "In addition to being a successful recording artist, 21 deserves to be reunited with his children immediately."

Also, even though Savage isn't a Roc Nation artist, Jay-Z's company has responded to what it calls a "matter of injustice" by hiring attorney Alex Spiro to assist with his case.

Spiro tells TMZ, "We are not going to stop until he is released, bonded out or in front of a judge ... What we have here is someone who overstayed their Visa with an application pending for 4 years - not a convicted criminal that needs to be detained and removed but, by all accounts a wonderful person, father, and entertainer who has a marijuana offense which was vacated and sealed."

We're told 21 actually had a U Visa permit pending for 4 years before he reapplied for one in 2017, which -- as we reported -- may have led to a background check that discovered his visa was expired and triggered his arrest.