Racing legend Al Unser Jr. won't have to spend any more time behind bars for his wild DUI arrest back in May ... 'cause TMZ Sports has learned he cut a sweet deal with prosecutors this week.
The 57-year-old was driving on an Indiana highway back on May 20 when police say they caught him going 59 MPH in a 45.
Cops say they saw his car swerving when they followed him to pull him over ... and when they stopped him, they say he wreaked of booze and showed all the signs of being drunk.