IDF troops at the Erez border crossing shot and killed a female Palestinian pilgrim returning from Mecca and wounded four others on Sunday night, according to Palestinian accounts. The military, however, said the woman died on the Palestinian side of the crossing, and that troops were only firing back at Hamas gunmen who opened fire towards Israel, Israel Radio reported. It was unclear whether the woman died from Israeli or Palestinian fire. The IDF said the incident in the southern Gaza Strip was still being examined. The Palestinians also said four other people were wounded by IDF fire. The crisis surrounding the return of some 3,000 Palestinian pilgrims to Gaza appeared to be nearing its end earlier Sunday, as Israel permitted some of them to cross through the Allenby Bridge and some 600 pilgrims were expected to enter the Strip through Erez. The pilgrims had been stranded aboard two Egyptian ferries for the past few days after the Egyptian authorities refused to allow them to return home through the Rafah crossing. The pilgrims allowed in through the Allenby Bridge had left the country legally and in coordination with the Palestinian Authority and Israel. As for the remaining pilgrims, Col. Nir Press, commander of the Gaza Coordination Liaison, said Israel was prepared to let all of them return through the Kerem Shalom crossing, but only after undergoing security checks and coordinating the move with Egypt and the PA. Hamas insists that the pilgrims be allowed to return home through the Rafah crossing - a demand that has been rejected by Egypt, Israel and the PA. However, Israel is concerned Egypt will be forced into succumbing to Hamas pressure and will allow the remaining pilgrims to enter the Gaza Strip through Rafah. The Egyptian authorities were said to have agreed late Sunday to allow the remaining pilgrims through the Rafah crossing. Palestinian sources said an agreement had been reached between the PA, Hamas and Egypt over the return of the pilgrims. The sources said the Palestinians would be allowed to enter the Gaza Strip after undergoing thorough checking to make sure that none of them was carrying weapons or large amounts of cash for Hamas. The Palestinians - some of them known Hamas terrorists who Israel suspects traveled to Iran for military training and might be carrying cash and weapons - left Gaza earlier this month, supposedly to participate in the hajj in Mecca. Hamas leaders have denied the charges, saying they were unaware of "wanted" Hamas men or attempts to smuggle weapons and cash into the Gaza Strip. "The Egyptian authorities have searched the bags of all the pilgrims, and they didn't find anything suspicious," said Saleh al-Raqab, a minister in the Hamas government. "The pilgrims are only carrying their clothes and some gifts." Other Hamas leaders accused the PA leadership in Ramallah of inciting the Egyptians not to allow the pilgrims to return home through the Rafah terminal. They said PA officials wanted to punish the pilgrims because they had left the Gaza Strip without seeking permission from the PA government in Ramallah. Despite Israeli objections at the time, Egypt decided unilaterally to open the Rafah border crossing and allow the pilgrims to leave Gaza. According to Egyptian officials, Egypt had no choice but to open the crossing, since thousands of pilgrims had stormed the facility and stood the risk of being trampled and killed. On Sunday, more than a thousand Palestinian pilgrims trapped in Egypt boarded buses taking them to temporary camps in the northern Sinai until authorities could decide where and how they would cross into the Gaza Strip. A total of 3,000 Palestinians have arrived in the port city of Nuweiba in southern Sinai on two ferries, and authorities plan to send a second batch of buses to transport those who remain to the Gaza border. Egypt has set up 11 temporary camps in El-Arish to house the pilgrims until authorities come up with a solution to the current crisis. AP contributed to this report.