Exxon has won its legal battle against the Treasury Department’s Office of Foreign Assets Control and will not have to pay a $2 million civil penalty levied by OFAC in 2017 for violating Ukraine-related sanctions regulations, a federal judge ruled this week.

The dispute over the fine issued in July 2017 by Treasury Secretary Steven Mnuchin concerned a joint exploration contract Exxon had with Russia’s state-run oil company Rosneft. At that time, Rosneft CEO Igor Sechin, who signed the business deal between the two companies, had been added to OFAC’s Specially Designated Nationals and Blocked Persons (SDN) List in April 2014.

Rosneft itself, however, was a non-blocked entity—the main argument Exxon held its hat on. According to court documents, Exxon argued OFAC’s enforcement action was “fundamentally unfair and constitute[d] a denial of due process under the Constitution and violate[ed] the Administrative Procedure Act, because market participants, including ExxonMobil, did not have notice of the interpretation OFAC now seeks to retroactively enforce.”

Exxon also pointed to statements made by the White House and Treasury Department that sanctions involving Sechin applied only to his personal affairs and not to companies he managed or represented. A March 2014 White House Fact Sheet stated, “Our current focus is to identify these individuals and target their personal assets, but not companies that they may manage on behalf of the Russian state.”

Exxon argued it followed clear guidance from the White House and Treasury Department when it signed documents involving ongoing oil and gas activities in Russia with Rosneft. “At the time of the signing, those activities themselves were not under any direct sanction by the U.S. government,” Exxon argued.

Judge Jane Boyle of the U.S. District Court for the District of Texas sided with Exxon. In her Dec. 31 opinion, Boyle ruled OFAC’s penalty violated the Due Process Clause of the Fifth Amendment “by depriving Exxon of fair notice.” In her ruling, Boyle noted Exxon’s failure to seek guidance from OFAC prior to executing the contracts at issue was “risky and, perhaps, imprudent,” but it “does not sway the court’s decision.”