Tory Lanez’s surprise appearance at Rolling Loud could land him in jail.

Prosecutors claim the Toronto rapper violated a court order to stay away from Megan Thee Stallion at the Miami festival. According to TMZ, a motion has been filed to hold Tory in contempt for violating the restraining order that was issued in his ongoing criminal case.

Tory is accused of shooting Megan in the foot last summer. The judge’s order requires him to stay at least 100 yards away from Megan, who was reportedly still backstage when Tory made a surprise appearance during DaBaby’s set, which came less than an hour after Megan performed on the same stage.

DaBaby performed two songs on which Megan is featured, “Cry Baby” and “Cash Shit,” before and after Tory hit the stage. Megan and her team were reportedly “very upset” and felt that it mocked her ongoing criminal case.

Prosecutors are asking the judge to either revoke Tory’s bail, which could land him in jail pending trial, or at the very least increase his bail.

Prosecutors also believe Tory and DaBaby attempted to rush the stage while Megan was performing at Rolling Loud on July 25. However, a source close to Tory claims he never saw Megan nor did he get physically close to her.

A hearing on the contempt motion is set for Thursday, Aug. 19.