The prime suspect in the murder of Jerusalem teen Muhammad Abu Khdeir announced that he was “the messiah” upon entering the court Sunday.

Yosef Haim Ben-David was in Jerusalem District Court as his indictment was read for the the July 2 abduction and killing of the 16-year-Shuafat resident in an alleged revenge attack for the killing of three Israeli teens on June 12.

Ben-David’s lawyer, Aharon Roza, said that the statement shows that the suspect was in deep mental distress, and asked for Ben-David to be examined by an outside psychiatrist.

The defendant is expended to plead temporary insanity.

According to Channel 2, Roza said during the hearing, “I met the client in severe mental distress, and he spoke disconnectedly about all sorts of messianic things, and about demons who tell him what to do.

“He is disconnected from reality at this stage, and says he is the messiah, son of David, which matches his name.”

Ben-David, 29, is a resident of the West Bank settlement of Adam and owns an eyewear store in Jerusalem. His detention has been extended until the end of his legal proceedings.The other two suspects, both minors, have not been named.

The Jerusalem District Court, September, 2012. (photo credit: Yonatan Sindel/Flash90)

The Jerusalem District Court, September, 2012. (photo credit: Yonatan Sindel/Flash90)

Ben-David is one of three suspects indicted on July 17 for the crime. Two of the defendants were also charged with the attempted kidnapping of a seven-year-old Palestinian boy in Beit Hanina the night before the killing, attempted arson, and the torching of a Palestinian store in the West Bank village of Hizme in June.

The indictment said that the three suspects went on “a human hunt,” during which they “cruelly kidnapped and murdered the minor Muhammed Abu Khdeir simply for being an Arab.”

Attorney General Yehuda Weinstein strongly condemned the “grave and shocking” crime, which was “carried out against an innocent youth on racist grounds,” and “opposes basic human morality.”

The other suspects are two 16-year-olds — one from Jerusalem, the other from Beit Shemesh. According to the indictment, Ben-David and one of the minors have a history of mental illness and are presently on medication.

Immediately after the killing, the suspects said they went to the older defendant’s home, where they “played guitar and went to sleep.”

The three have confessed to the killing; they reenacted it in the police interrogation. They said it was meant to avenge the June 12 killing of the three Israeli teenagers — Eyal Yifrach, 19; Naftali Fraenkel, 16; and Gil-ad Shaar, 16 — who were laid to rest a day before the murder of Abu Khdeir.

They said that following the discovery of the three bodies on June 30, two of the defendants plotted to harm Arabs in retaliation. The night the bodies were found, they attempted to snatch the 7-year-old Beit Hanina child, but were fought off by the boy’s mother.

The next night, with the third defendant in tow, they drove around again to find a victim and abducted Abu Khdeir.

The indictment stated that the three, who were raised in Orthodox families, changed their clothes to look like secular Israelis, filled bottles with gasoline, and brought along handcuffs.

While scouting out potential victims, they spoke with various children, but decided not to abduct them and briefly considered kidnapping an adult. The three then saw Abu Khdeir sitting on the side, and approached him to determine if he was a Palestinian. They asked him for directions to Tel Aviv and Damascus Gate, and he began to respond before growing suspicious and attempting to call his friends for help. The defendants then grabbed the struggling teenager, pushed him into the car, and beat him with a tire iron.

Upon reaching the forest, the adult suspect shouted: “This is for the Fogel family!” “This is for Shalhevet Pass!” in reference to previous Israeli terror victims, while striking Abu Khdeir. He then hit him three more times for the slain Israeli teenagers.

The killing of Abu Khdeir sparked riots among Israel’s Arab population throughout the country, and drew fierce domestic and international condemnation. Seven suspects were initially arrested, but four were released days later.

Marissa Newman contributed to this report.