Israel’s Prime Minister, Ariel Sharon, said the killings were “a Jewish terror act” aimed at disrupting the pullout from all Gaza settlements and four in the West Bank.
Israeli police said the assailant was a driver who had taken Palestinian workers to jobs in Shiloh, a West Bank settlement.
Once there, he snatched a security guard’s gun and turned it on his passengers. The settler then fired at others in the industrial zone before being arrested by police.
The shooting occurred hours after Israeli forces began removing settlers and their supporters from several Gaza settlements as part of a pullout which Israeli opponents see as capitulation to a Palestinian uprising that began in 2000.
Palestinian leader Mahmoud Abbas appealed to militant groups not to take any retaliation for the killings.
He urged Palestinian gunmen not to respond to “provocations and not to provide any pretexts or excuses to those wishing to halt the Israeli withdrawal from Gaza.”
Palestinian militants have threatened to renew attacks that they have scaled back in recent months at the request of Mr Abbas, who seeks a smooth handover of Gaza.
“By freeing the hand of settlers to shed Palestinian blood, the enemy is opening the door for resistance factions to respond to these Zionist crimes which take place during the calm,” a spokesman for the Islamic militant group Hamas said.
The Islamic Jihad group issued a similar statement but said any retaliatory attacks would take place in the West Bank or Israel, but not in Gaza.
Earlier, Mr Sharon said he had been moved to tears at the sight of settlers being taken from their homes, but warned them not to vent their anger on the troops.
“I want to appeal to everyone not to attack the police and soldiers and not to blame them or make things difficult for them,” he said.
“Attack me. I am responsible for this. Attack me. Blame me.”
Some 230,000 Jews live in settlements scattered among the 2.4 million Palestinians of the West Bank.
Israel is removing about 8,000 settlers from Gaza, home to 1.4 million Palestinians.
In the Gaza Strip, officials said the operation to dismantle 21 settlements could take six days, far quicker than the original estimate of six weeks.
A working group to co-ordinate the takeover of the settlements once the Israelis leave will include representatives of Hamas and Islamic Jihad.