Gazprom Neft PJSC, the oil arm of Russia’s state-controlled energy giant Gazprom, will repay $3 billion of bonds early after sanctions imposed by the European Union made it illegal for the debt to remain in the market.

EU penalties forbid dealing with Russian state companies, but there’s a carveout for transactions “strictly necessary” for purchasing or transporting oil, natural gas and other commodities. According to a May 4 filing from the vehicle Gazprom Neft used to sell the debt, that loophole doesn’t apply to some of its bonds, triggering an “illegality event” clause for debt due Sept. 2022 and Nov. 2023, which means they must be redeemed early.

The repayment could hand investors a quick win. That’s because the illegality clause—under which an introduction or change in any applicable law or regulation makes it unlawful for the lender to have all or part of a debt instrument outstanding—forces the company to pay the debt at par, regardless of where its trading on the secondary market. The notes are currently quoted at around 55 cents on the dollar.

EU sanctions imposed on Russia on March 15 forbid any transaction with companies established in Russia and controlled by the government or the Central Bank after May 15.

Those sanctions exclude transactions “strictly necessary” for the purchase and transport of certain commodities from Russia into the European Union. But the exclusions don’t apply to bonds, according to GPN Capital SA, the Luxembourg vehicle that issued the two securities. As a result, GPN has asked Gazprom Neft to repay the notes by May 12.

Gazprom Neft’s press office didn’t respond to an emailed request for comment sent Tuesday evening.