TALLAHASSEE, Fla. (AP) — A Florida judge is ordering the removal of a Democratic candidate for attorney general from the ballot.

Circuit Judge Karen Gievers ruled Friday that Ryan Torrens had flouted the state's campaign finance laws in order to qualify for the race.

She concluded that the Tampa attorney relied on an illegal contribution in order to have enough money to pay the $7,738 qualifying fee.

Gievers ruling comes just four days before the state's primary. Torrens is challenging state Rep. Sean Shaw in the race. Two Republicans are running on the GOP side. Attorney General Pam Bondi is leaving office due to term limits.

In her ruling, Gievers told state election officials that Torrens cannot be declared the winner even if he gets more votes than Shaw.