GAZA CITY — The Gaza Strip’s land border with Egypt reopened Saturday after a 50-day closure, but only for three days and then just for special cases, its Islamist rulers Hamas said.

Passage to Egypt will be limited to those seeking medical treatment, students going to their places of study, foreigners and in cases deemed as humanitarian, Hamas’s interior ministry said.

A busload of Palestinians heading for Egypt was the first vehicle through the crossing in the city of Rafah, which is also open to traffic in the opposite direction.

Egypt has severely restricted access through the crossing since July, when the army deposed Hamas’s ally, president Mohamed Morsi of the Muslim Brotherhood.

On Tuesday, Filippo Grandi, head of the UN Palestinian refugee agency (UNRWA) urged Egypt to let people through Rafah, saying only a handful of Muslim pilgrims had been allowed across over seven weeks.

He also called on Israel to ease its blockade of the territory, imposed in 2006. The only other crossing for people out of Gaza is at Erez, which leads to Israel.

Many Gazans travel through Rafah to seek medical treatment outside of the impoverished Strip.

After Morsi’s overthrow, the army destroyed hundreds of tunnels under the border that brought in construction materials and fuel. That caused the Strip’s worst ever energy crisis, with power outages of up to 16 hours a day.

This month, Hamas described the Rafah closure as a “crime against humanity,” and the UN criticized it for its effect on “the civilian population, including patients awaiting medical treatment.