JERUSALEM — Thousands of Palestinians on Friday took part in a mass protest along Gaza’s volatile border with Israel, the second large-scale demonstration in what is expected to be a steady turnout over the coming weeks.

Nearly 30 Palestinians were killed by Israeli fire in two mass protests over the past eight days.

Gaza’s Hamas rulers, who are orchestrating the demonstrations, say the protests are against a decade-old border blockade by Israel. But Israel accuses the Islamic militant group of using the protests as cover for trying to infiltrate the border and attack Israelis. It has warned that anyone approaching the border fence is risking their lives.

Here’s a closer look at how the sides reached this point:

THE HAMAS TAKEOVER

Israel captured Gaza, a thin strip of land along the Mediterranean coast, from Egypt in the 1967 Mideast war and occupied the area for nearly four decades before withdrawing all troops and settlements in 2005. Hamas, a militant group sworn to Israel’s destruction, won legislative elections the following year and in 2007 seized control of Gaza from the internationally recognized Palestinian Authority, headed by President Mahmoud Abbas.

Israel and Egypt have maintained a blockade on Gaza in an attempt to weaken the group. Since then, Israel and Hamas have fought three wars, while attempts at internal Palestinian reconciliation have repeatedly failed, in large part because of Hamas’ continued refusal to disarm.

Israel has defended the wars as a response to intense rocket fire from Hamas-ruled Gaza, and notes the group’s history of suicide bombings and other deadly attacks, especially during the second Palestinian uprising early last decade. But the wars have left several thousand Palestinians dead, more than half of them civilians, drawing heavy international criticism.

WHY NOW?

The blockade, wars, international isolation and failed attempts at reconciliation have left Gaza’s economy in tatters.

Unemployment is approaching 50 percent, according to official Palestinian figures. Gaza’s 2 million residents receive only a few hours of electricity each day, tap water is undrinkable and the coastline has been polluted by tons of untreated sewage. The Israeli-Egyptian blockade greatly restricts the movement of people and goods in and out of the small territory of barely 360 square kilometers (139 square miles) making it difficult to do business or travel abroad for work, school or family reasons.

Hamas says the demonstrations are meant to draw attention to the harsh conditions in Gaza. But with public discontent rising, it also appears to be an attempt by the group to shake up the situation after other options failed.

Hamas can also capitalize on any hatred of Israel among Gazans, over half of whom are descendants of refugees from what is now Israel.

WHY DOESN’T ISRAEL EASE THE BLOCKADE?

Israel says its blockade is aimed only at Hamas, and it has no quarrel with Gaza’s civilians. It has been careful to allow the continued flow of humanitarian goods and construction materials into Gaza, and says it will ease the blockade further based on security assessments.

But international organizations like the World Bank and United Nations say the blockade continues to stifle the economy. They have repeatedly urged Israel to ease the restrictions significantly.

Israel says it has no choice, accusing Hamas of trying to smuggle weapons and materials that can become weapons into the territory. It also has asked the international community, which already funnels hundreds of millions of dollars a year into Gaza, to increase aid.

WHY HAVE THE PROTESTS TURNED VIOLENT?

While thousands of Palestinians have gathered for what are billed as nonviolent protests, dozens of young men have approached the border and thrown stones, firebombs and burning tires toward the border fence. Israel has mobilized snipers and other special forces on the other side of the fence.

The Israeli military says Hamas has been using the demonstrations as cover for attacks, and says militants have attempted to carry out shootings, plant bombs and infiltrate the fence in order to attack inside Israel.

Military officials say they have used live fire only as a last resort when all other alternatives, including warning shots and rubber bullets, have failed to stop the demonstrators from reaching the fence. It says it has targeted only main “instigators” trying to carry out attacks.

But witness accounts and amateur videos have shown some demonstrators appeared to be unarmed or far from the fence when they were shot. The United Nations and European Union have called for an independent investigation and urged all sides to show restraint.

WHAT’S NEXT?

Hamas has called for a series of demonstrations in the coming weeks, culminating on May 15, the 70th anniversary of Israel’s establishment. Palestinians mark the date as their “naqba,” or catastrophe, when hundreds of thousands were forced or fled from their homes.

Friday’s demonstrations were smaller, and the death toll was lower than last week’s demonstrations, suggesting the protests could be weakening.

But Hamas’ top Gaza official, Yehiyeh Sinwar, made a surprise visit to one of the protests and appeared to issue a new threat. “Wait for our great move, when we breach the borders and pray at Al-Aqsa,” referring to the major Muslim shrine in Jerusalem.

With Israeli communities lying just a few hundred meters away from the border, Israel has made clear that it will not accept any breach.

Sinwar’s threat could set the stage for another serious round of violence in the coming weeks.