An Israeli court has approved the detention of a Palestinian man who broke into the Turkish embassy in Tel Aviv and allegedly took two hostages.
Nadim Injaz can be kept in jail for a week to allow police to investigate the incident, the Israeli Courts Administration said.
Mr Injaz was arrested after the hostage drama on Tuesday evening.
His lawyer has said Mr Injaz was a former Israeli informer seeking political asylum.
Turkish Foreign Minister Ahmet Davutoglu said after the incident that Mr Injaz forced his way into the embassy compound carrying a knife, a can of petrol and a toy gun.
The attacker claimed to be a Palestinian and asked for asylum, Mr Davutoglu added.
Mr Injaz later retreated to an upper floor of the embassy after being shot and freeing the hostages.
After his arrest Mr Injaz was taken to hospital with gunshot wounds to one leg.
His lawyer, Avital Horev, said Mr Injaz was wanted by the Palestinian Authority for collaborating with Israel.
"During the 1990s and the early part of this decade, he stopped Palestinian attacks, saving many lives both of soldiers and Israeli citizens," Mr Horev said.
The lawyer also said that the Palestinian Authority had signed a death warrant against his client.
"But [Israeli security agency] Shin Bet, from whom he asked for protection, refused to recognise its responsibility towards him."
However, a spokeswoman for Shin Bet said that Mr Injaz "never worked for us".
Mr Injaz is from the West Bank town of Ramallah and is reported to have a history of mental illness.
In 2006, he stormed the British embassy in Tel Aviv and tried to demand asylum.