A federal court in Washington, D.C., sided with Sen. Ted Cruz in his lawsuit challenging a Federal Election Commission restriction on the use of post-election funds to pay off loans candidates make to their own campaigns.

In an opinion handed down Thursday, District Judges Timothy Kelly and Amit Mehta, joined by Judge Neomi Rao of the U.S. Court of Appeals for the D.C. Circuit, found the FEC cap on the donations—which blocks campaigns from using more than $250,000 in post-election gifts to pay back candidates—implicates First Amendment interests. The judges found the commission couldn’t prove that the rule effectively prevents quid pro quo corruption or is narrowly tailored for that reason, and therefore the restriction “runs afoul of the First Amendment.”