Conor McGregor is one lucky scofflaw ... because TMZ Sports has learned he's on the verge of striking a deal in his New York City criminal case that will keep him in the U.S. and out of jail.

We've learned Conor's lawyer is in the final stages of negotiating a plea deal in his felony mischief case ... the case that was filed after the UFC champ unleashed his fury by hurling a dolly into a UFC bus, injuring 3 fighters. His target was UFC rival Khabib Nurmagomedov, who was not hurt.

Conor was charged with one count of felony criminal mischief and 3 counts of misdemeanor assault.

Sources familiar with the deal tell us, prosecutors have agreed to reduce the felony to a misdemeanor. That's hugely significant because a felony involving violence could trigger permanent deportation from the U.S.

TMZSports.com

The Irish bad boy faced 7 years behind bars if convicted, but we've learned prosecutors are agreeable to probation ... NO jail time.

The deal is not finalized, but we're told negotiations are down to the "fine points." If it doesn't fall apart, the deal should be finalized in a matter of days, because Conor is due in a Manhattan court Thursday.