PEMBROKE PARK, Fla. – Federal court records make it clear that James Medina was threatening to attack a synagogue before the FBI charged him in what was widely reported as a thwarted terror attack.

But before he made those alleged threats, Medina also threatened a church, his estranged wife, his in-laws and, according to someone who knew him on the streets, just about anyone who looked at him the wrong way.

"He threatened everyone," said Rick Wallace, who said he met Medina while volunteering at the Jubilee Center of South Florida. "He was insane. He was a homeless guy on drugs. He is not a terrorist. He's just someone that needs to be in a hospital somewhere. C'mon man, no terrorist is homeless and eating up here (at the Jubilee Center).”

Wallace said Medina even threatened him once, when he tried to help him at the Hollywood center, which provides services to the homeless and where Medina, who'd been living on the streets for the past several years, listed his address. He said that when he tried to give Medina a hand, he threatened to cut him.

"But he'd never pull out a knife," said Wallace. "I was in his face trying to help him, but I was in his face, and he didn't like it. So he got threatening. He was an OK guy. He was just crazy. Words is words. Do you know easy words are to say? I could say the sky is pink. That don't make it true. It just means I don't what the heck I'm talking about."

Medina was arrested in 2012 after leveling threats against his in-laws and the church they attended. His former brother-in-law, Jimmy Hon, said that at times he believed he was God and was prescribed medication used in treatment for bipolar disorder. Medina also suffered a serious head injury in a car accident five or six years ago, he said.

"He stopped working and he got into drugs, and it fell off from there," said Hon. "I hope he gets the help he needs. We've been hoping for that a long time."

Medina's federal public defender, Joaquin Padilla, said in a court hearing Tuesday that family members had twice had him involuntarily committed to mental health facilities and that his mental illness had gone untreated. Medina's estranged ex-wife, with whom he has a son and who asked not to be named, told Local 10 News that she was incredulous when she heard the news of his arrest.

"I thought he's not a terrorist," she said. "He's just crazy, and he needs to get some help because he's not on his medication."

Yet media coverage of the case made Medina sound rather sophisticated, with a plan to strike on Yom Kippur and to make it appear the terror group ISIS was behind the attack. But the 17-page federal criminal complaint charging Medina with a single count of attempted use of a weapon of mass destruction makes it clear that he didn't come up with those ideas -- the FBI's confidential informant did. In fact, the complaint's transcribed conversations show that the informant, working hand-in-hand with FBI agents, orchestrated nearly all the details of the plan.

The complaint even sheds doubt on whether Medina -- a former Catholic who said he blamed wars and the world’s problems on Jews and identified as Muslim – came up with the idea in the first place. In the first recorded meeting with the informant, which occurred March 27, Medina said, "You just want to go to 167th 'cause this over here wants to blow some (expletive) up at (a) synagogue over there … that's why he wants to go over there 'cause he wants you to stake out the place."

The FBI identifies that person only as "an associate present at the time," who appears to have the intials "BH." That person falls into the background of the investigation and was never charged with a crime. It was only later that another associated with the initials "TI" told the informant that Medina wanted to "shoot up a synagogue in Aventura." Shortly thereafter, the confidential informant appears to question Medina's intention, saying, "Medina is suicidal. He's not a Muslim."

A few days later, on April 1, the informant picked up Medina in his car and as they drove around. Medina allegedly led the informant to the synagogue and said, “You gotta know when to go like.” According to the complaint, the informant "took up the thought and offered a proposal."

"You know what Yom Kippur is?” he asked Medina.

"Yom Kippur? I heard of that," answered Medina.

"Yeah, uh, it's like a Jewish holiday. It's in two weeks," the informant said.

"Hmmm, well now, that'll be a good day to go and bomb them," said Medina.

The informant was actually mistakenly referring to Passover. The informant then told Medina they needed to leave a "clue" as who was responsible, to which Medina said they might leave a banner with Arabic letters on it. It was then the informant suggested they blame it on ISIS or Shabaab, an al-Qaeda-backed terrorist group. Medina readily took the bait.

"You can do all that," he said. "Yeah, we can print up something and make it look likeit's ISIS here in America."

The informant then took Medina out to lunch, where he discussed his conversion to Islam four years prior (which coincides with the time frame when he was allegedly threatening former family members and their church). Medina allegedly told him that a synagogue attack would give "hope and light to other Muslims in America" and his belief that Jews "are the ones causing the world's wars and conflicts." He then said that the associate, identified as TI, had AK-47s that they could use to attack the synagogue. It was then the informant suggested to use a bomb instead.

Later, the informant told Medina that he had a contact that could supply the bomb. They then conducted more surveillance on the building and spoke of inflicting as much killing and damage as possible.

Medina said it would be a "wake-up call."

"Yo, that sounds awesome, bro," Medina said later. "I'm down. I'm down. I'm up for it, big time. Big time.”

On April 29, an undercover FBI employee gave Medina a fake bomb and drove him to the synagogue. When he got out with the fake bomb and began walking toward the center, he was taken into custody by FBI agents. Medina readily admitted to agents after his arrest that he planned to attack the synagogue to "strike back for all the wars," according to the complaint.

In his first appearance in court, Medina interrupted proceedings and called himself "James Mohammed."

Homeless advocate Sean Cononie, who counted Medina as a client at his now-closed homeless shelter in Hollywood, said that upon reading the complaint he felt that Medina was largely led by the informant into what ultimately seemed like a credible plot.

"I think the informant pushed him in that direction, which can easily be done with someone who suffers from mental illness," Cononie said.

Cononie said he believes Medina should have been institutionalized and treated long ago, but said there simply aren't services and beds available for mentally ill people with no health insurance, let alone for those who are homeless. A large percentage of homeless people suffer mental disorders, he said, and many throw threats around with no intention of backing them up. But, he said, Medina's apparent willingness to bomb the synagogue -- whether he had the means to do it without the FBI's help or not -- made him too dangerous for the streets.

During the hearing, FBI agent David Clancy echoed that thought when he didn't dispute that Medina was mentally ill, but claimed that made him no less a danger to the public.

"Did they get a dangerous guy off the streets? Yes," Cononie said. "Did they do it the proper way? I don't know."