Attacker “appeared to be mentally disturbed” and has no links with organised groups, according to Ankara officials.

Police have shot and detained a knife-carrying Turkish man who tried to force his way into the Israeli embassy in Turkey’s capital Ankara.

The man, armed with a 30cm knife, ran towards the embassy shouting slogans and was shot in the leg, the governor’s office in Ankara said in a statement on Wednesday.

Officials said initial investigations showed that the man, identified as 41-year-old Osman Nuri Caliskan from the central Anatolian city of Konya, “appeared to be mentally disturbed” and had no record of links with any organised group.

OPINION: What the Israeli-Turkish reconciliation says about Gaza

“A man approached the embassy with a knife and was shot by a local guard. Everyone on our side is safe,” Emmanuel Nahshon, spokesman for the Israeli foreign ministry, said in a statement.

“The assailant was wounded in the foot. We don’t know if he was attacking police officers or the embassy itself.”

He added that the assailant only managed to reach the “outer perimeter” of the building, but said the incident was still being investigated.

READ MORE: Turkish aid flows into besieged Gaza Strip

Israel’s embassy in Ankara said in a statement that the suspect “tried to stab a Turkish police officer” in front of the mission.

“The embassy trusts the Turkish forces to control and investigate the incident,” it added.

Turkey’s NTV television said employees of the embassy took refuge in a shelter during the incident.

Caliskan was taken to Ankara’s Numune Training and Research Hospital, according to Turkey’s state-run Anadolu Agency.

Roads around the embassy were closed after the incident and specialist police officers were sent to the scene.

The Hurriyet daily reported that the attacker told police officers interrogating him at the hospital that he “did this to stop the bloodshed in the Middle East”.

READ MORE: Four held for alleged UK, German embassies plot in Turkey

Foreign missions in Turkey have been on a state of high alert following a spate of attacks across the country this year blamed on Islamic State of Iraq and the Levant (ISIL) and Kurdish separatist groups.

The British embassy in Ankara was closed on Friday over security concerns.

Three months ago, Turkey and Israel signed a deal to restore their ties which hit an all-time low after the 2010 raid by Israeli commandos on a Gaza-bound Turkish aid ship that left 10 Turks dead.

Under the deal, the two countries are to begin the process of exchanging ambassadors to fully restore their diplomatic ties, although this has yet to formally take place.