Israel has launched air strikes against militant targets in the Gaza Strip, after rockets were fired from the territory towards Jerusalem.
The Hamas-run Palestinian health ministry in Gaza said nine people, including children, had died in the strikes.
In Jerusalem, the rocket fire caused Israel's parliament to be evacuated as sirens sounded.
Tensions between Israel and the Palestinians spiralled in recent days.
Gaza's Hamas rulers had threatened to strike after hundreds of Palestinians were injured in clashes with Israeli police in Jerusalem on Monday.
Israel said it had killed three Hamas militants. "We have started, and I repeat started, to attack military targets in Gaza," Israeli military spokesman Lt Col Jonathan Conricus told reporters.
Hamas sources told the BBC a commander of the Izzedine al-Qassam Brigades, Mohammed Abdullah Fayyad, had been killed.
The past few days have seen the worst violence in Jerusalem for years, with more than 300 Palestinians wounded in confrontations with Israeli police outside the al-Aqsa mosque on Monday.
A planned march by Israeli nationalists which was due to pass through Muslim areas of East Jerusalem's Old City was called off over fears it could stoke unrest.
The Jerusalem Day event marks Israel's capture of East Jerusalem - home to the Old City and its holy sites - in 1967, and usually sees hundreds of flag-waving Israeli youth make their way through the Muslim Quarter via Damascus Gate, chanting and singing patriotic songs.
It is regarded by many Palestinians as a deliberate provocation. This year's march is also taking place in the final days of the Islamic holy month of Ramadan.
The latest violence follows days of clashes between Palestinians and Israeli police in the nearby Sheikh Jarrah district of East Jerusalem, with the possible eviction of Palestinian families from their homes there by Jewish settlers a focal point for Palestinian anger.
Israel's Supreme Court had been due to hold a hearing in the long-running case on Monday, but the session was postponed due to the trouble.
What happened at the al-Aqsa mosque?
Israel's police force said thousands of Palestinians barricaded themselves in the building overnight with stones and Molotov cocktails in anticipation of a confrontation during the Jerusalem Day Flag March, which was scheduled to start at about 4pm local time.
Officers were ordered to enter the mosque compound to "repel the rioters using demonstration dispersal methods" on Monday morning after a police post was attacked and stones were thrown towards a nearby road, it added.
For over an hour, police fired stun grenades, rubber bullets and tear gas at Palestinians, who threw stones and other objects.
Video posted on social media showed crowds running for cover and some of the stun-grenade canisters landing inside the mosque.
The al-Aqsa mosque, the third holiest site in Islam, is located on a hilltop complex known by Muslims as the Haram al-Sharif (Noble Sanctuary) and by Jews as the Temple Mount. Jews revere it as the location of two Biblical Temples and it is the holiest site in Judaism.
During clashes outside the Old City walls, a car was pelted with stones before crashing into bollards and hitting a man.
The Palestinian Red Crescent said 305 Palestinians were injured in the clashes, and that 228 were taken to hospital for treatment. Seven of them are in a critical condition.
The Israeli police force said 21 officers were injured and that three required hospital treatment.
Israel's Prime Minister, Benjamin Netanyahu, defended the police.
"This is a battle between tolerance and intolerance, between lawless violence and order," he said. "Elements that want to expropriate our rights periodically force us to stand strong, like Israel's police officers are doing."
Palestinian Authority President Mahmoud Abbas condemned the Israeli actions.
"The Israeli occupation forces' brutal storming and assault on worshippers in the blessed Al-Aqsa Mosque and its courtyards is a new challenge to the international community," spokesman Nabil Abu Rudeineh said.
Confrontations between Palestinians and Israelis were also reported in the northern Israeli city of Haifa, and near the West Bank city of Ramallah.
King Abdullah II of Jordan, which is the custodian of Jerusalem's Islamic and Christian holy sites, condemned "Israeli violations and escalatory practices at the blessed al-Aqsa mosque".
Jordan assumed custody of the sites when it occupied the West Bank and East Jerusalem in the 1948 Middle East war, and was allowed to continue the role after the areas fell to Israel in 1967.
The Quartet of Middle East negotiators - the US, the EU, Russia and the UN - has also expressed deep concern over the violence, urging all sides to show restraint.
Why is Jerusalem a flashpoint?
The city, with its sacred sites, is the most sensitive place of all in the decades-old conflict between Israel and the Palestinians.
Alongside its religious importance are national claims too - Israel in effect annexed East Jerusalem and considers the entire city its capital, though this is not recognised by most other countries.
Palestinians claim the eastern half as the capital of a hoped-for state of their own.
The hilltop compound containing the al-Aqsa mosque and buttressed by the Jewish holy site of the Western Wall is especially sensitive, with both Israel and Palestinians wary of each other's intentions and activities there.
Israel says the current violence there was planned "well in advance" by Palestinian extremists, though a series of events has driven unrest in Jerusalem.
Palestinian anger fuelled in the past few days by the uncertain fate of the families in Sheikh Jarrah came after a month of escalating tensions in the city.
After Ramadan began in mid-April, clashes erupted nightly between police and Palestinians protesting against security barriers outside Damascus Gate, worsening after a march by ultra-nationalist Jewish extremists angry over assaults by Palestinians on ultra-Orthodox Jews.
Meanwhile rare Palestinian elections planned for this month were called off by Palestinian President Mahmoud Abbas, who blamed restrictions on Palestinian voting rights in East Jerusalem, in a move which further angered Palestinians. Critics suggested Mr Abbas feared a victory by his party's Islamist challengers Hamas.