MONSEY, N.Y. -- A man charged with federal hate crimes Monday in a bloody attack on a Hanukkah celebration had handwritten journals containing anti-Semitic references and had recently used his phone to look up information on Hitler and the location of synagogues, authorities said.

Grafton Thomas, 37, was held without bail after appearing in federal court in White Plains on five counts of obstructing the free exercise of religious beliefs by attempting to kill with a dangerous weapon. Five people were stabbed and slashed in the Saturday attack north of New York City.

A blood-stained 18-inch (45-centimetre) machete was recovered from his car, along with a knife smeared with dried blood and hair, prosecutors said in a criminal complaint.

Thomas, his ankles shackled, shuffled into the courtroom in a prison jumpsuit, telling a judge who asked him if his head was clear that he was "not clear at all" and needed sleep. But he added: "I am coherent."

His court-appointed attorney, Susanne Brody, said Thomas has struggled with bipolar disorder and schizophrenia. Another attorney retained by his family, Michael Sussman, said Thomas had been hearing voices and may have stopped taking psychiatric medications recently.

The stabbings on the seventh night of Hanukkah came amid a series of violent attacks targeting Jews in the region that have led to increased security, particularly around religious gatherings.

A criminal complaint said journals recovered from Thomas' home in Greenwood Lake included comments questioning "why ppl mourned for anti-Semitism when there is Semitic genocide" and a page with drawings of a Star of David and a swastika.

A phone recovered from his car included repeated internet searches for "Why did Hitler hate the Jews" as well as "German Jewish Temples near me" and "Prominent companies founded by Jews in America," the complaint said.

On the day of the stabbings, the phone's browser was used to access an article titled: "New York City Increases Police Presence in Jewish Neighborhoods After Possible Anti-Semitic Attacks. Here's What To Know," the complaint said.

Sussman told reporters he visited Thomas' home and found stacks of notes he described as "the ramblings of a disturbed individual" but nothing to point to an "anti-Semitic motive" or suggest Thomas intentionally targeted the rabbi's home.

"My impression from speaking with him is that he needs serious psychiatric evaluation," Sussman said. "His explanations were not terribly coherent."

Thomas' family said he was raised to embrace tolerance but has a long history of mental illness, including multiple hospitalizations.

"He has no history of like violent acts and no convictions for any crime," his family said in a statement. "He has no known history of anti-Semitism and was raised in a home which embraced and respected all religions and races. He is not a member of any hate groups."

Thomas served in the Marines and was president of his class at a high school in Queens, Sussman said. He attended William Paterson University between 2005 and 2007, the university confirmed, where he played football as a walk-on running back.

Thomas' family said his mental health deteriorated over the years. He would hear voices and have trouble completing sentences at times. Thomas said a voice talked to him about property that was in the rabbi's house, according to Sussman.

In court papers filed in a 2013 eviction case in Utah, Thomas said he suffered from schizophrenia, depression and anxiety and his "conditions are spontaneous and untamed."

Thomas was arrested within two hours of the Saturday night attack in Monsey. When police pulled his car over in Manhattan, he had blood all over his clothing and smelled of bleach but said "almost nothing" to the arresting officers, officials said.

Thomas' aunt told The Associated Press that he had a "germ phobia" and obsessively washed his hands and feet with bleach.

She said Thomas grew up in the Crown Heights neighbourhood of Brooklyn and "lived peacefully" among Jewish neighbours. She said Thomas had not been taking his medication and recently went missing for a week.

The woman spoke on the condition of anonymity out of fear she would lose her government job for speaking publicly.

"They're making him look like this monster," she said in a telephone interview. "My nephew is not a monster. He's just sick. He just needs help."

According to the complaint, Thomas, a scarf covering his face, entered the rabbi's home next door to a synagogue and said "no one is leaving." He then took out a machete and started stabbing and slashing people in the home packed with dozens of congregants, the complaint said.

The five victims suffered serious injuries -- including a severed finger, slash wounds and deep lacerations -- and at least one was in critical condition with a skull fracture, the complaint said.

On Sunday, Thomas pleaded not guilty to charged including five counts of attempted murder. He was detained on $5 million bail.

In a release, U.S. Attorney Geoffrey S. Berman said Thomas "targeted his victims in the midst of a religious ceremony, transforming a joyous Hanukkah celebration into a scene of carnage and pain."

Thomas' criminal history includes an arrest for assaulting a police horse, according to an official briefed on the investigation who was not authorized to discuss the matter publicly and spoke to the AP on condition of anonymity. A lawyer representing Thomas at the arraignment said he had no convictions.

The criminal complaint said one passage in Thomas' journals stated that the "Hebrew Israelites" took from the "ebidnoid Israelites." The FBI agent who wrote the complaint said that appeared to be a reference to the Black Hebrew Israelite movement, some branches of which have been associated with anti-Semitism.

The attack was the latest in a string of violence targeting Jews in the region, including a Dec. 10 massacre at a kosher grocery store in New Jersey. Last month in Monsey, a man was stabbed while walking to a synagogue. No arrest has been made in that stabbing.

Gov. Andrew Cuomo, a Democrat, said Saturday's savagery was the 13th anti-Semitic attack in New York since Dec. 8.

Monsey, near the New Jersey state line about 35 miles (56 kilometres) north of New York City, is one of several Hudson Valley communities that has seen a rising population of Hasidic Jews in recent years. At a Sunday celebration that was planned before the attack, several members of the community stood guard armed with assault-style rifles.

"The Jewish community is utterly terrified," Evan Bernstein, the regional director of the Anti-Defamation League of New York and New Jersey, said in a statement. "No one should have to live like this."

In New York City, the Rev. Al Sharpton appeared Monday with Jewish and other faith leaders at his Harlem headquarters and said he was disturbed and upset that several of the suspects in recent attacks on Jews have been black.

"We cannot remain silent as we see a consistent pattern of attacks on people based on their faith and who they are," Sharpton said. "You can't fight hate against you if you aren't willing to fight hate against everybody else."