BANGKOK (AP) — A Thai court on Thursday convicted two Iranian men of taking part in a botched bomb plot that was exposed last year when an accidental explosion blew apart the Bangkok villa where they were staying, and sentenced them to long prison terms.

Israeli and Thai officials have said the plot was aimed at Israeli diplomats in Bangkok, Thailand's capital, though Iran denied the allegations and neither defendant was charged with terrorism or attempting to kill Israelis.

The court sentenced Saeid Moradi, 29, to life in prison for attempting to murder a police officer, possessing illegal explosives and causing explosions that damaged property and injured several civilians. It sentenced 43-year-old Mohammad Kharzei to 15 years in jail for possessing explosives.

The pair was detained in February 2012, shortly after a cache of homemade explosives accidentally blew apart their villa. Both claimed innocence, saying they had been unaware of the explosives in their home.

They were among five Iranians suspected to be involved in the blasts.

Defense lawyer Kittipong Kiattanapoom said he would consult with both men and their families to find out whether they want to appeal.

Moradi, a factory technician from Tehran and a former soldier, had faced a death sentence.

He lost parts of both legs as he tried to flee the villa on a crowded Bangkok street. He was carrying explosives from the house and dropped them in the street as police tried to stop him.

One police officer and five civilians were injured in the incident, including a taxi driver who drove his vehicle on top of one of the bombs Moradi had dropped onto the street.

Moradi had said he was carrying the explosives out of the house in an attempt to dispose of them. He also said he was not aware that the explosives were similar to "sticky" bombs used against Israeli diplomats in foiled attacks a day before the Bangkok incident in India and the former Soviet republic of Georgia. Investigators said the bombs found at the Bangkok home had round, coin-like magnets on them.

Kharzei has testified that he was not a terrorist and had nothing to do with the explosions. He said he had not known Moradi until they met at an airport in Tehran before boarding their flight to Thailand.

The court also ordered the pair to jointly pay 2 million baht ($62,800) to the owner of the house blown off by the first explosion. Moradi was also asked to compensate a telephone company for a damaged telephone booth.

Another suspect, Iranian Masoud Sedaghatzadeh, 31, was detained in Malaysia, where he has appealed an extradition order. He met Moradi and Kharzei in the Thai resort city of Pattaya, and fled to Malaysia the day after the explosion.

Israel believes the botched plot was part of a covert war against Israeli interests abroad that has intensified in recent years because of Iran's alleged quest to develop nuclear weapons.

The Israeli ambassador to Thailand, Simon Roded, called the two suspects "terrorists."

"This sentence proves once again that Iran is engaged in the proliferation of terror all around the world," he said.