* Three rockets strike near Israeli city of Beersheba
* Israel calls attack "grave" violation of ceasefire
* Attack occurs during talks in Cairo on Gaza deal
* Ceasefire was due to expire at 2100 GMT (Releads with rockets fired at Israel)
By Nidal al-Mughrabi and Stephen Kalin
GAZA/CAIRO, Aug 19 (Reuters) - Three rockets fired from Gaza hit Israel on Tuesday and Prime Minister Benjamin Netanyahu ordered the military to strike back, Israeli officials said, hours before a truce with Palestinian militants was set to expire.
The rocket salvoes were launched as Egyptian mediators, holding separate meetings with Israeli and Palestinian negotiators, struggled to reach a long-term deal on the future of the Gaza Strip.
A military spokeswoman said the three rockets landed in open areas near the city of Beersheba and there were no reports of casualties. Reuters witnesses in Gaza City said they heard the sound of launches from the Palestinian enclave.
"This rocket attack was a grave and direct violation of the ceasefire," Mark Regev, a spokesman for Netanyahu said.
There was no immediate claim of responsibility for the rocket salvoes, and Israeli retaliation appeared imminent.
"In response to Hamas's violation of the truce, the prime minister and defence minister have ordered the IDF (Israeli Defence Forces) to once more attack terror sites in the Gaza Strip," said a government official, who spoke on condition of anonymity.
Earlier, in Cairo the chief Palestinian delegate to the indirect negotiations with Israel cautioned that violence could erupt anew if the talks failed.
After a last-minute agreement was struck on Monday to extend by 24 hours, until 2100 GMT on Tuesday, a deadline to reach a truce, Azzam al-Ahmad, senior leader of President Mahmoud Abbas's Fatah movement, said there had been "no progress on any point" in the negotiations.
The Palestinians are demanding an end to the Egyptian and Israeli blockades of the economically-crippled Gaza Strip, where Israel launched an offensive on July 8 after a surge in Hamas rocket fire across the border.
Israel, like Egypt, views Hamas, the Islamist group which dominates the impoverished enclave, as a security threat and wants guarantees any removal of border restrictions will not result in militant groups obtaining weapons.
"We hope that every minute of the coming 24 hours will be used to reach an agreement, and if not (successful), the circle of violence will continue," Ahmad said.
Palestinian officials held more meetings on Tuesday with Egyptian mediators. An Israeli government official said Israeli delegates were still in Cairo poring over details of a possible deal, although the parties had not yet agreed a draft.
An agreement would open the way for reconstruction aid to begin to flow to the Gaza Strip, where thousands of homes have been destroyed in the conflict and the United Nations said 425,000 people have been displaced.
The Palestinian Health Ministry put the Gaza death toll at 2,016 and said most were civilians in the small, densely populated coastal territory. Israel has said it killed hundreds of Gaza gunmen in the fighting. Sixty-four Israeli soldiers and three civilians in Israel have been killed.
An Israeli official, who asked not to be identified, said Israel's delegation had been instructed to insist at the talks that its security requirements be met.
(Additional reporting by Maayan Lubell in Jerusalem; Ori Lewis; Writing by Maayan Lubell; Editing by Jeffrey Heller and Angus MacSwan)