James Medina, 41, was sentenced by a U.S. judge on Tuesday to 25 years in prison for trying to blow up a synagogue in Florida during a Jewish holiday last year, court officials said.

The Federal Bureau of Investigation began watching Medina, who had converted to Islam, after he began expressing anti-Semitic views and a wish to attack a synagogue. They launched an investigation in late March 2016.

James Medina spent more than a month scouting out a synagogue in Aventura, Florida, near Miami, where he mapped out the area and working out how to cause the most destruction.

Fortunately, Medina was intercepted by an undercover FBI informant whom he told all his plans to. Medina was supplied with what he thought was an explosive device by federal law enforcement. The device was inert and posed no danger to the public, federal law enforcement said in court filings.

He was taken into custody as he approached the synagogue with the inert device and later admitted to his crimes, they said. No one was hurt.

Medina told investigators that he planned to “kill Jews” because he believed “Jewish people were responsible for the world’s wars and conflicts”. He added, “it’s my call of duty”.

In a video he recorded of himself before he carried out the attack, Medina said, “I am Muslim and I don’t like what is going on in this world. I’m going to handle business here in America. Aventura, watch your back. ISIS is in the house.”

Investigators say Medina wanted to inspire other people to carry out similar attacks.

Jimmy Han, a good friend and former brother-in-law of Medina, explained that a few years ago Medina’s glass repair business fell on tough times, his marriage failed and, most crucially, he lost the ability to see his son.

“He was really hurt that it didn’t get to see his son for a long time,” Jimmy said.

It is this which is believed to have sent Medina on dangerous downward spiral that included and included him lashing out at those closest to him, including Jimmy’s family.

“He said he was going to behead my wife, he was going to set me on fire and blow up my house,” Jimmy said.

Jimmy Han was eventually forced to file charges against Medina and get a restraining order, but the charges were eventually dropped.

Jimmy believes that the man who threatened him and tried to carry out this attack was not the same man he once knew.

The judge who passed the sentence ruled that James Medina will first be treated at a US prison medical facility for a brain cyst and mental illness before being moved into the general prison population and serve out his 25 year term.