At least 21 Palestinians were killed Thursday as Israeli troops seized empty Jewish settlements and pushed towards densely populated Gaza towns.

The Israeli Defense Forces (IDF) said one Israeli soldier was killed as it expanded a week-old incursion into Gaza to create a buffer zone to prevent Palestinian militants from firing rockets into southern Israel.

Israeli officials expended the offensive, launched last week to pressure Palestinian militants to release a captive Israeli soldier, after Hamas members fired two homemade rockets into the southern Israeli city of Ashkelon. No one was hurt, but Israeli leaders were infuriated by the attacks.

Israeli aircraft targeted Palestinian militants with missile strikes throughout the day, while Israeli ground forces took up positions among the tightly packed Palestinian homes. Israeli helicopters hovered overhead, providing cover fire for soldiers engaged in fierce skirmishes with masked Palestinian gunmen.

The IDF said one of its soldiers was fatally shot in the head on the outskirts of Beit Lahiya, the focus of the fighting Thursday as Israeli forces conducted their largest operation in Gaza since withdrawing from the coastal territory less than a year ago.

Visit FOXNews.com's Mideast Center for more in-depth coverage.

CountryWatch: Israel

A senior government official said Israeli troops would enter the densely populated towns of Beit Lahiya and Beit Hanoun — which militants often use to launch rockets. Speaking on condition of anonymity because he wasn't authorized to discuss military plans, he said the incursions would be temporary.

"We are doing the utmost effort ... to avoid civilian casualties," said Israeli Brig. Gen. Ido Nehushtan. "Really there is no other way of operating against terrorists who are operating inside their own civilian populations."

Israeli leaders said their aim is to stop the rocket fire and bring back the captured soldier, 19-year-old Cpl. Gilad Shalit. They said there are no plans to reoccupy Gaza or carve out a permanent buffer zone.

"We have no intention of drowning in the Gaza swamp," Defense Minister Amir Peretz said.

"Return Gilad alive and healthy, stop firing rockets and we will return our soldiers to their bases," Peretz said in a speech.

Asaf Shariv, spokesman for Israeli Prime Minister Ehud Olmert, denied media reports that Israel had received new messages from Hamas softening its demands for a large-scale prisoner release.

He ruled out any prisoner release, telling The Associated Press it would encourage "military actions against Israeli soldiers and make (militants) want to kidnap more and more people."

Israeli tanks and ground forces rumbled into the abandoned settlements overnight, and moved several miles into Gaza as the day progressed. Most of the fighting was concentrated in the outskirts of Beit Lahiya. Army Radio said the area had been used to launch the rockets that struck Ashkelon.

Late in the day, an Israeli airstrike killed four Palestinians, while two other Palestinians were killed in a gunbattle, Palestinian officials said. The army said it had targeted groups of gunmen in two airstrikes.

A Palestinian was killed in a separate shootout in the area, Palestinian officials said.

In other fighting, an Israeli airstrike in northern Gaza early Thursday killed a Hamas militant and wounded a second, Hamas officials said. Two militants were killed in an airstrike in the southern town of Khan Younis, Palestinian officials said. The army said the airstrikes had targeted militants who were attacking troops.

A Hamas militant and a Palestinian policeman were killed and 11 people wounded in an explosion along the northern part of the Gaza beach. Palestinians said Israel shelled the area. The army denied that and was investigating the cause of the blast.

Fierce gunbattles erupted throughout the day, the military said. The army said one soldier was slightly wounded, while Palestinian medics said at least four Palestinians, including an 18-year-old woman, were wounded.

The abandoned Gaza settlements — Nissanit, Dugit and Elei Sinai — lie just south of the border with Israel. Before Israel dismantled its Gaza communities last year, critics of the withdrawal warned the pullout would put more Israeli cities within rocket range.

A buffer zone could be the only way to keep Israeli population centers out of rocket range. But such a zone brings back bitter memories of a similar tactic Israel used in southern Lebanon, when its forces held onto a security zone for 18 years in an attempt to prevent Hezbollah guerrillas from firing rockets at Israel.

The guerrillas still fired rockets and the zone became a deadly battlefield. Public pressure finally forced Israel to withdraw in May 2000.

Hamas's military wing said Wednesday the rockets fired at Ashkelon were a new longer range weapon that can hit targets at least 7 1/2 miles away. Such a range could require Israel to push the buffer zone further into Gaza, bringing forces into populated areas the army is reluctant to enter.

Israel invaded Gaza last week after Shalit was captured by Hamas-linked militants who infiltrated Israel. Israeli forces have been massed in southern Gaza for more than a week in search of the soldier. Israel also has arrested Hamas ministers and lawmakers, and restricted movement of people and goods in and out of Gaza.

Nine detained Palestinian lawmakers appeared at a hearing Thursday, declaring they would not accept the court's authority and shouting "we are hostages," Israeli prison officials said. The men were removed from the courtroom and their detentions extended.

Palestinian Prime Minister Ismail Haniyeh called Thursday on Arab and Islamic countries as well as international groups to protect the Palestinian people and stop the Israeli operation.

"Solving issues can't be through military escalation or expanding their scope, but through stopping the aggression, and respecting the will of the Palestinian people and answering to their nationalist just demands," he said.

Israel clamped a total closure on Gaza after the soldier was captured, trying to prevent militants from moving him out of Gaza.

In the last two days, Israel has reopened two crossings to allow badly needed food and fuel into Gaza. But Israel reclosed the Karni cargo crossing, citing a security threat.

The Associated Press contributed to this report.