"We know that a number of Palestinians crawled towards the border fence," the Israeli spokeswoman said. "They know that it is a dangerous area but they did not heed repeated calls to stop and they planted a suspicious device close to the fence."
She added that the third person, who was slightly wounded, was taken to an Israeli hospital but that none of those spotted in the area were small children.
"Hamas is trying to draw us [Israel] into their civil war"
Zafon, Beersheva, Israel
Send us your views
Suleiman Abu Zeibeida, a brother of one of the boys, said they had gone to the beach to go swimming.
An aide to Ismail Haniya, the Palestinian prime minister, said the boys were not were not involved with any armed group.
"The children were in a Palestinian area, close to the beach and they posed no danger to anyone. They were shot and killed without mercy," Mohammed al-Madhoun said.
"Our children are very dear to us and we urge the international community to compel the occupation to stop its crimes against children and innocent Palestinians."
The two boys were buried later on Friday evening with hundreds of Gazans marching in the funeral procession.
Later on Friday, a member of Islamic Jihad was killed in an Israeli air strike in the southern Gaza Strip, a medical source and witnesses said.
Fadi Abu Mustapha died as he rode his motorbike in the southern Gaza town of Khan Yunis, the medic said. Witnesses told the AFP news agency the man was a local leader of Islamic Jihad.
About 50 Palestinians have been killed during the past two weeks as Israel has targeted Hamas facilities, commanders and fighters in response to Qassam rocket attacks from the Gaza Strip which have killed two Israelis.
Israel has rebuffed calls by Mahmoud Abbas, the Palestinian president, for a ceasefire under which Gaza fighters would halt cross-border rocket attacks and Israel would stop its bombing campaign in the coastal strip.
Hamas, which formed a unity government with Abbas's Fatah faction two months ago, says any ceasefire must include an immediate end to all Israeli attacks in both Gaza and the occupied West Bank - a demand rejected repeatedly by Israel.
Palestinian and Israeli officials are expected to meet in the Occupied Territories for the first time on June 7.
The violence is expected to dominate the agenda of the meeting between Abbas and Ehud Olmert, the Israeli prime minister.
"The president is working night and day for a mutual, comprehensive ceasefire," Nabil Abu Rdeneh, an Abbas aide, said on Friday.