A bomb detonated at a Jerusalem bus stop Wednesday, killing a 59-year-old woman, injuring 38 people and shattering the relative calm that had pervaded the city for several years.

The attack came as tensions have escalated between Israelis and Palestinians in the West Bank and Gaza Strip, and it prompted vows of reprisals from Israeli politicians who warned that they would take the necessary steps to restore the country’s security.

On Thursday, Israel launched several airstrikes in Gaza, Reuters reported.

Interior Minister Eli Yishai told reporters at the scene of Wednesday’s bombing that a recent surge in attacks on Israelis demanded a tough response.

“I see escalation on various fronts, including the southern theater and Itamar,” Yishai said, referring to rocket attacks fired from Gaza on southern Israeli towns and the killing of five members of an Israeli family living in a West Bank settlement on March 11. “This combination requires us to act, because otherwise we shall lose our deterrent power. We had quiet for a few years, and we must not let it evaporate,” Yishai was quoted by local media as saying.

The Jerusalem attack came after seven years without such a deadly bombing in the city. No group asserted responsibility, but Israeli police blamed Palestinian militants.

The bombing came as tensions continue to soar along Israel’s border with the Gaza Strip, where overnight the Israeli air force said it killed a Palestinian militant preparing to fire a rocket. That death followed the killing of eight other Palestinians — four civilians and four militants — by Israeli military forces Tuesday in what Israel described as retaliatory strikes.

President Obama condemned the Jerusalem bombing, as well as the rockets and mortar shells fired from Gaza in recent days, and said Israel has a right to self-defense. He also expressed condolences to Palestinians, acknowledging the death of civilians in Gaza on Tuesday.

“We stress the importance of calm and urge all parties to do everything in their power to prevent further violence and civilian casualties,” Obama said.

A bomb hidden in a bag detonated near Jerusalem’s central bus station shortly after 3 p.m., injuring people who were waiting at a bus stop as well as passengers aboard a bus that was passing by on its way out of town. The victim was identified as a British tourist, Reuters reported Thursday.

Though less deadly in its scope than the suicide bombings that routinely ripped through Israeli buses, particularly in the late 1990s, the attack set the city on edge.

“When terror attempts to disrupt our way of life, the best solution is to get back to normal as quickly as possible,’’ Jerusalem Mayor Nir Barkat said, vowing that a marathon scheduled to take place in the city Friday would go ahead as planned.

Israeli Prime Minister Binyamin Netanyahu postponed his diplomatic trip to Moscow for several hours to consult with Israeli security officials.

“Israel will act aggressively, responsibly and wisely to preserve the quiet and security that prevailed here over the past two years,” Netanyahu said before his plane took off. His departure suggested that he felt assured that the security situation was stable enough for him to be out of the country for a few days.

Israeli military analysts cautioned against linking the Jerusalem bombing with the escalation in Gaza, saying they could be unrelated events, even if together they led to heightened tensions.

In Israel’s southern towns and cities, residents took cover in shelters Wednesday as sirens alerted them to fresh mortar and rocket fire. Schools were closed in major towns such as Beersheba and Ashdod as a precautionary measure.

Israeli news stations switched between images of the damaged bus and Israelis rushing to take cover in shelters in the south. Throughout the day, an Israeli Cobra helicopter circled over the border between Gaza and Israel as puffs of smoke from landing mortar shells rose in the background.

Israel waged a blistering, deadly air campaign against the Gaza Strip in 2009 designed to stop rocket fire. That war ended with Hamas, the Palestinian militant group, still in control of the territory and an uneasy stalemate in place that has been pocked by periodic exchanges of fire.

Silvan Shalom, Israel’s vice premier, told Israel Radio before the bus attack that the situation recalled the period that led up to that war, and he warned of a possible broader Israeli response.

“We may have to consider a return to that operation,” Shalom said. “I say this despite the fact that I know such a thing would, of course, bring the region to a far more combustible situation.”

Defense Minister Ehud Barak predicted a longer, more moderate engagement.

The Israeli military “will continue to work to defend the citizens of Israel and to thwart attacks along the Gaza Strip security fence,” he said. “There will be ups and downs. Not everything will end tomorrow, but we are determined to bring the calm back to the area.’’