GAZA CITY, Gaza Strip — The turmoil in neighboring Egypt has rippled into the Gaza Strip, stranding thousands of people on both sides of the border and causing a fuel shortage as the Muslim holy month of Ramadan begins.

The looming crisis is threatening to divide families and cause new hardship in Gaza when extended families gather for large meals every evening to break the daily Ramadan fast.

Some relief is at hand. Egyptian officials say they will reopen the crossing for six hours on Wednesday, but they make no promises about letting up on smuggling tunnels, a key for funneling many goods into Gaza, where Israel limits the type of imports through its crossings for punitive and security reasons.

"Gaza is a trap. Once you get in, you don't know when you can get out," said Nawal Fahmi, a 42-year-old Gaza native who is trying to return to her home in Saudi Arabia for Ramadan. "You are a hostage to politics."

Fahmi, teacher who was in Gaza to visit relatives ahead of the holiday, is among thousands caught there by the closure of the Rafah border crossing. Thousands more are in Egypt waiting to return to Gaza.

With the border closed, Egyptian airport officials in Cairo were detaining dozens of Gaza-bound Palestinians and forcing them to fly back to their points of departure. Normally they would cross Egypt's Sinai Peninsula overland and enter Gaza through the Rafah crossing.

Egypt limited operations at the Rafah crossing, the main transit point for people in and out of Gaza, in the wake of the June 30 ouster of Islamist President Mohammed Morsi and closed it altogether on Friday.

Maj. Gen. Sami Mitwalli, who is in charge of the border on the Egyptian side, confirmed plans to open the crossing.

Maher Abu Sabha, a Palestinian border official, said 12,000 people were waiting to travel, including college students, people who work abroad, or people waiting for medical service not available in Gaza.

He said thousands were also waiting to come home, including 800 Muslim pilgrims stranded in Saudi Arabia who were not being allowed to board Egypt-bound flights.

The Egyptian military has also closed off much of the normally bustling system of smuggling tunnels that run under the 15-kilometer (9-mile) border. Egypt is concerned about movement of militants back and forth between Gaza and Sinai through the illicit tunnels as it struggles to control jihadi elements in the desert peninsula.

Israel limits the entry of cement, glass and other construction materials into Gaza, saying they could be diverted for Hamas military use, and fuel shipped in from Israel is more than twice the price of subsidized Egyptian fuel. Israel imposed a blockade when Hamas took power in Gaza in 2007 but has eased it over the years. Hamas is a bitter enemy of Israel.

The sudden shortage of Egyptian fuel has led to long lines at Gaza gasoline stations in recent days. Traffic is uncharacteristically light on Gaza's chronically overcrowded roads. Power outages, already common in Gaza, have worsened.

"We are approaching the holy month of Ramadan. If this crisis continues, it means hardship for everyone in Gaza," said Ibrahim Saleh, a 33-year-old taxi driver. "Without fuel, life in Gaza will be paralyzed."

Egypt itself is suffering from a fuel shortage, evidence of its economic crisis, at least partly explaining the reduction of shipments to Gaza.

Guy Inbar, an Israeli defense official, said Israel was prepared to increase the deliveries of fuel or other supplies through special cargo crossings. He said Hamas, which does not recognize Israel, had not made any such requests. "All Palestinians need to do is to ask for them," he said.

The Gaza electric company said it would ration fuel to ensure that all areas receive 12 hours of power a day during Ramadan.

Dr. Ashraf al-Qedra, spokesman for Hamas' Health Ministry, said many key services were already being scaled back.

"We are working to manage the crisis. We reduced some of our services and rescheduled non-urgent surgeries," he said. "We have stopped using 40 percent of our cars and use them only for emergencies."

Ihab Ghussein, spokesman for the Hamas government, warned that other sectors, such as wastewater treatment and public transportation, were also threatened. Egypt's crackdown on the tunnels, begun last month, has already ground the construction sector to a standstill.

Ghussein said the government has been in touch with Egypt to alleviate both the fuel shortage and the travel restrictions.