Kanye West has dodged a potentially messy legal battle.

According to Page Six, the 39-year-old rapper has settled a hefty lawsuit in which he was accused of sampling a Hungarian man’s music without permission. Court documents show West reached an out-of-court deal with the plaintiff on Monday, just two days before he was scheduled for a deposition. Terms of the agreement have not been disclosed.

The charges, which were announced in May of 2016, pertain to the hit track “New Slaves” from 2013’s Yeezus. Composer Gabor Presser claimed West had used his 1969 song “Gyöngyhajú Lány” (“The Girl with Pearly Hair”) for a large chunk of “New Slaves”—a minute and 15 seconds, to be exact. Presser said he didn’t know about the sample until after it was being used for the album’s promotional campaign. The composer reportedly reached out to West’s team with the hopes of making a deal; however, Presser said he never signed a licensing agreement and was simply given a $10,000 advance that he never cashed.

After several failed negotiation attempts, the Hungarian artist filed a $2.5 million copyright infringement lawsuit.

The trial was set to begin on May 15.