LIMA, PERU -- A Peruvian judge has ordered 18 months of preventative detention for an Iranian and two Peruvian men while they are investigated for allegedly attempting to kill two Israelis living in the South American country.

The ruling by Magistrate Miguel Quevedo was handed down Tuesday but released Wednesday. The defendants are also accused of conspiracy to commit terrorism.

The judge said the motive for the unsuccessful alleged killing plot was unclear, but police and prosecutors in Peru have said the Iranian, Majid Azizi, could be a member of the Quds Force of the Islamic Revolutionary Guard, which is responsible for intelligence work outside Iran.

The Associated Press could not independently confirm whether Azizi is a member of the Quds Force. Iranian authorities have not commented.

On March 15, after Azizi's arrest, the Israeli embassy in Lima thanked the Peruvian police and prosecutor’s office in a press release “for having dismantled an Iranian attack that was directed against an Israeli citizen.”

Prosecutors in Peru have subsequently said that images, messages and testimonies were found indicating that Azizi contacted Peruvians Walter Loja and Angelo Trucios in March to plan the killing of Israeli Shachar Malka.

Malka, who is alive, has said on social media that he has been working as a tour guide and healer with traditional plants in Cusco, the ancient capital of the Incas, for more than five years.

The other Israeli citizen who they allegedly planned to kill was Gilad Duchovny, who opened a cafe in Cusco in 2006 with his twin brother.

According to the judge, “it has been established with a high degree of plausibility” that Azizi conspired with the Peruvians to kill the Israelis. Police found information about Malka and Duchovny in Azizi’s Lima house. One of the Peruvians arrested, Trucios, has a conviction for murder and aggravated robbery.

Azizi’s defense has denied all the charges against him and says he suffers from a serious heart condition.

Peruvian authorities say Azizi entered Lima on March 3, and they were alerted about him by foreign intelligence offices.

Iran has run intelligence operations in South America in the past, particularly through the expeditionary Quds, or Jerusalem, Force of its paramilitary Revolutionary Guard.

Iran maintains close ties to Venezuela. The Quds Force was linked to an impounded Boeing 747 in Argentina and later seized by the United States. And most notoriously, Argentina believes Iran was behind the 1994 bombing of a Jewish center that killed 85 people.

This is the first time Peruvian authorities have announced the arrest of an alleged member of that group.