Israel's military launched a West Bank manhunt Thursday, setting up checkpoints and blocking roads, after a Palestinian gunman killed two Israeli soldiers at a bus stop outside a West Bank settlement and sped away.

The shooting added to a deadly week that claimed seven lives, including an Israeli newborn, a 60-year-old Palestinian businessman and three Palestinian assailants, two of them members of the Islamic militant Hamas.

Israeli Prime Minister Benjamin Netanyahu said he would "settle accounts" with Thursday's attackers, while Palestinian President Mahmoud Abbas held Israel responsible for what he said was a violent environment.

After consulting with top security officials for several hours, Netanyahu beefed up troop levels in the West Bank, ordered detentions of Hamas activists and called for demolishing the homes of assailants within 48 hours.

Netanyahu also said he would legalize thousands of existing West Bank settlement homes whose status was in question and ordered his attorney general to make arrangements for construction of 82 new homes in Ofra, the scene of one of this week's attacks. Most of the international community considers all Israeli settlements on war-won lands illegal, whether they have been sanctioned by Israel's government or not.

"Our guiding principle is that whoever attacks us and whoever tries to attack us will pay with his life," Netanyahu said at a military ceremony.

Following Thursday's attack, Israel set up checkpoints on the outskirts of the West Bank city of Ramallah, searching cars and checking the IDs of drivers entering the Palestinians' typically quiet center of government and commerce. Some Israeli-controlled roads were completely blocked to Palestinian traffic.

Lt. Col. Jonathan Conricus, an Israeli military spokesman, said the measures were aimed at preventing "copycat" attacks. "We know that when there is one attack there may be others," he said.

Inside Ramallah, streets were empty and shops were shuttered as the Palestinians called a general strike to protest Israel's actions, including the killing of two wanted militants.

Abbas condemned the violence, criticizing both militant attacks and the tough Israeli response. He accused Israel of creating a climate conducive to violence and alleged it was inciting against him.

"This atmosphere created by the frequent Israeli raids of the cities, and the incitement against the president and the absence of the peace hopes, lead to this series of violence that both peoples are paying the price for," he said in a statement.

This week's violence began with a Palestinian drive-by shooting that wounded seven Israelis outside the settlement of Ofra on Sunday night and led to the death of a baby boy who was delivered prematurely after his mother was critically hurt in the attack.

Late Wednesday, Israel killed Salah Barghouti, one of the suspects in the shooting, and overnight its forces killed another Palestinian man, Ashraf Naalweh, wanted in an attack that killed two Israelis in October. Both men were said to have been armed.

On Thursday, a Palestinian man stepped out of a vehicle and opened fire at a bus stop outside Givat Assaf, an unauthorized settlement outpost near Ramallah, before speeding away, the military said. It said two soldiers, Sgt. Yovel Moryosef, 20, and Cpl. Yosef Cohen, 19, were killed, while another soldier was critically wounded.

In Jerusalem's Old City, meanwhile, Israeli police said they killed a Palestinian attacker who stabbed two officers.

Late Thursday, the army said it shot and killed a Palestinian motorist in what it called an attempted car ramming attack. Palestinians challenged the account, saying the motorist was a wealthy 60-year-old factory owner who had no incentive to carry out such an attack and had apparently panicked when he saw the soldiers.

Israeli officials accuse Hamas of being behind the recent shootings. Hamas, which controls the Gaza Strip, said that Barghouti and Naalweh both were members, but stopped short of claiming responsibility for their attacks.

Hamas has been leading border protests against a blockade of Gaza in which 175 Palestinians have been killed by Israeli army fire since March. Israel and Egypt have enforced the blockade since the Hamas takeover of Gaza in 2007.

The latest West Bank violence came amid years-long diplomatic paralysis.

Peace talks have been frozen throughout Netanyahu's decade-long tenure, while Israeli settlements in the West Bank continue to expand. The Palestinians seek all of the West Bank, east Jerusalem, and Gaza Strip for an independent state.

The policies of President Donald Trump, whom the Palestinians accuse of being unfairly biased toward Israel, have added to a sense of frustration and hopelessness in the West Bank.

In a separate development, Palestinian witnesses interviewed by The Associated Press in the West Bank city of Tulkarem contradicted the military's claim that soldiers shot a 22-year-old man there last week during a violent disturbance.

The witnesses said Mohammed Habali, whom they described as mentally handicapped, was fatally shot in the back after leaving work in a coffee shop late one night last week.

The Israeli military initially said it had responded to Palestinian stone throwers. But security camera footage and the witness accounts have cast doubt on the army's version of events.

Witnesses say there was no unrest. Footage from four different security cameras also showed no rock throwing at the scene where Mohammed Habali was shot. In the footage, he is seen walking in an alleyway holding a stick when he is shot from behind and falls down on his face.

His family said he spoke slowly and could not grasp much of what took place around him. He had used the stick to help him walk after being injured in a car crash.

"We are sad and angry. We never expected my brother to be killed. He was never ever involved in any confrontations with the Israeli soldiers," said Alaa, Habali's brother.

The army announced this week that it was opening a military police investigation into the shooting. But the Israeli human rights group B'tselem, which gathered the security footage, said such investigations almost never result in prosecution.