Conservative writer and filmmaker Dinesh D’Souza was sentenced to eight months in a community confinement center and five years probation after he pleaded guilty to violating campaign finance laws.

D’Souza was sentenced on Tuesday.

For the first eight months of his probation he will be at a community confinement center in San Diego, per the order of Judge Richard Berman. D’Souza was also fined $30,000 and directed to receive “therapeutic counseling,” according to The Smoking Gun. Berman also ordered D’Souza to one day of community service per week during his probation, according to Reuters.

“It was a crazy idea, it was a bad idea,” D’Souza told Berman before he was sentenced. “I regret breaking the law.”

Back in May D’Souza pleaded guilty to reimbursing two donors who gave a total of $20,000 to Republican Senate candidate Wendy Long’s unsuccessful campaign against now-Sen. Kirsten Gillibrand (D-NY). In January, D’Souza was charged with one count of false statements and one count of making over $10,000 of contributions in the name of others.

Prosecutors were trying to get a 10- to 16-month prison sentence, according to Reuters.