Countries across the world have appealed for calm after days of unrest spiralled into retaliatory attacks by Israel and Palestinians.
The UK, US and EU urged Israel and the Palestinians to lower tensions after violence escalated on Monday night.
Palestinian militants fired rockets toward Jerusalem and, in response, the Israeli military launched air strikes against militant targets in the Gaza Strip.
Some 20 people, including children, had died in the strikes, Palestinian health officials in Gaza said.
Israel’s military said at least three members of the Hamas group that rules Gaza were among those killed.
Hamas had threatened to strike after hundreds of Palestinians were injured in clashes with Israeli police at a holy site in Jerusalem on Monday.
Israeli prime minister Benjamin Netanyahu warned of an open-ended operation against Gaza’s Hamas militant rulers, accusing them of crossing a “red line” with the latest rocket fire, and promising a tough response.
“Whoever attacks us will pay a heavy price,” he said, warning that the fighting could “continue for a while”.
The Israeli military said more than 50 rockets were fired into Israel throughout the evening, most of them aimed at southern Israeli towns near the border.
Lieutenant Colonel Jonathan Conricus said six rockets were aimed at Jerusalem, 60 miles away.
It was believed to be the first rocket attack on the city since a 2014 war.
Shortly after the sirens sounded, explosions could be heard in Jerusalem.
One rocket fell on the western outskirts of the city, lightly damaging a home and causing a brush fire.
The Israeli army said one rocket was intercepted and the others fell in open areas.
The Israeli army said an Israeli civilian in the country’s south suffered mild injuries when a vehicle was struck by an anti-tank missile from Gaza.
Abu Obeida, spokesman for Hamas’s military wing, said the attack on Jerusalem was a response to what he called Israeli “crimes and aggression” in the city.
“This is a message the enemy has to understand well,” he said.
He threatened more attacks if Israeli forces re-enter the sacred Al-Aqsa Mosque compound or carry out planned evictions of Palestinian families from an east Jerusalem neighbourhood.
Earlier, Israeli police firing tear gas, stun grenades and rubber bullets clashed with stone-throwing Palestinians at the iconic compound, which is Islam’s third-holiest site and considered Judaism’s holiest.
Tensions at the site have been the trigger for prolonged bouts of violence in the past, including the last Palestinian uprising.