Jerusalem Mayor Nir Barkat instructed his bodyguards to apprehend a Palestinian man who had just stabbed the ultra-Orthodox Jew in the stomach.
Mr Barkat said he and his staff were travelling in a car when he noticed the "terrorist" with a knife.
He and his bodyguard leaped from their car to stop the attacker.
The bodyguard drew his firearm and wrestled the 18-year-old attacker to the ground and held him until police arrived.
The 27-year-old victim suffered a stab wound to the stomach and was only "lightly injured" according to police.
#BREAKING PHOTOS Israel: Orthodox Jew stabbed in Jerusalem, terrorist apprehended, victim critical pic.twitter.com/2yRGZttQq3 @YiddishNews
— Meir Taub (@Meir_Taub) February 22, 2015
A police spokesman said the suspect was in Israel illegally and has been taken into custody for questioning.
Speaking to the Jerusalem Post, Mr Barkat said: "I was driving my car near [IDF] Square when suddenly my team saw the terrorist near us with a knife.
"Both myself and my bodyguard immediately jumped out of my car, my guard drew his weapon and we held the terrorist until police arrived, and immediately took care of the casualty who fortunately was lightly injured."
Police spokesman Mickey Rosenfeld said: "Police force are on heightened alert in Jerusalem after the attack. The Palestinian is being questioned by the police."
#BREAKING: Jerusalem, mayor Nir Barkat apparently caught attacker together with his body guard after the stabbing pic.twitter.com/Uz7yYYqwln
— Meir Taub (@Meir_Taub) February 22, 2015
He said that an investigation into the attack is continuing although there has been an increase in the level of security patrols around the centre of Jerusalem following the incident.
The motive for the attack was not clear but it came after a series of knife assaults by Palestinians on Israelis in recent months.
Last month, a knife-wielding Palestinian attacked passengers on a morning rush-hour bus in Tel Aviv, wounding 12 people, before being shot and wounded by a passing prison officer.
In December, a knife-wielding Palestinian wounded two Israeli police officers in Jerusalem's Old City.
JERUSALEM: Mayors Security apprehend Arab terrorist (18) who stabbed and lightly injured a 27 y/o man at Kikar Safra. pic.twitter.com/VWwpcljumI
— Meir Taub (@Meir_Taub) February 22, 2015
