A federal judge in Massachusetts has blocked Texas Attorney General Ken Paxton from pursuing a lawsuit against the Democratic online fundraising platform ActBlue, saying the state’s top lawyer and Republican nominee for U.S. Senate had taken the legal action to further his political aspirations.

“Paxton’s public statements in the wake of filing the case against ActBlue reveal his true motivation,” U.S. District Judge Richard Stearns said in a ruling on Thursday. “While a prosecutor is entitled to a large degree of prosecutorial discretion and has a right to make a considered public accounting of his actions, Paxton did not hesitate in drawing a connection between the lawsuit and his candidacy for Senate.”