In a few chaotic minutes of violence, during which at least 17 police officers and several protesters were lightly injured, Israeli security forces evacuated dozens of protesters from the synagogue at the West Bank outpost of Amona on Thursday afternoon, drawing to a close the evacuation of the illegal West Bank outpost.

The protesters had made the synagogue their last stand after over a day of evictions from the outpost starting Wednesday afternoon, with heavy clashes marring what police and others had hailed as a mostly orderly operation.

Police said they were attacked with tear gas or similar chemical materials, pepper spray, iron bars, rocks and other materials that the protesters had stockpiled ahead of time.

According to Magen David Adom, 42 of those injured in the two-day evacuation were police and border guards, and 15 were protesters, with injuries ranging from hypothermia to light bruises to a scorpion sting.

One police officer suffered chemical burns after a liquid was thrown in his face. Another officer’s shoulder was dislocated during the clashes with protesters, said a spokesperson for Hadassah Hospital, where 35 of those injured were taken for treatment — 27 to the Mount Scopus branch, 18 to Ein Kerem. Another 12 were taken to Shaare Zedek Medical Center.

“I want to be clear: We did not use those kinds of materials,” police spokeswoman Meirav Lapidot said, referring to the gas which was seen to billow from the synagogue as dozens of elite police personnel forced their way in and evacuated the building.

The rabbi of the illegal outpost, Yair Frank, one of the last to leave the building, refused to answer when asked if he had sanctioned and condoned the violence, and whether it constituted a desecration of God’s name. “We’re not a democratic state,” Frank said. “The people want Amona to stay.”

“The police used violence too,” said Itamar Ben-Gvir, one of the leaders of the protest, rejecting the accusation that the protesters had desecrated the place of worship.

Graffiti daubed on the wall of Amona synagogue shows a swastika and the slogan 'Ishmael Police' -- a reference to the Israel Police force and to Ishmael, the son of the biblical patriarch Abraham believed by some to be the forebear of today's Arabs. (screen capture: Channel 2)

Graffiti daubed on the wall of Amona synagogue shows a swastika and the slogan ‘Ishmael Police’ — a reference to the Israel Police force and to Ishmael, the son of the biblical patriarch Abraham believed by some to be the forebear of today’s Arabs. (screen capture: Channel 2)

Graffiti found on the walls inside the synagogue included a swastika with the Israel Police symbol at its center. Other graffiti called for “Death to Zionists” and castigated “Zion-Nazis” and “Zionists from hell.”

Public Security Minister Gilad Erdan slammed the protesters inside the barricaded synagogue as “hooligans who hold Judaism in contempt and have no respect for religion, the synagogue or rabbis.”

Jewish Home MK Bezalel Smotrich, who was at the scene, said the protesters crossed a “red line.”

Israeli police forces evacuate people from the synagogue of the illegal outpost of Amona, on the second day of the eviction on February 2, 2017. (Yonatan Sindel/Flash90)

Israeli police forces evacuate people from the synagogue of the illegal outpost of Amona, on the second day of the eviction on February 2, 2017. (Yonatan Sindel/Flash90)

Hours of unsuccessful negotiations had preceded the forced evacuation of the synagogue, the final building to be cleared at the outpost after the 40 homes of its residents were evacuated on Wednesday and earlier Thursday.

“We made every effort” to avoid the forced evacuation, Prime Minister Benjamin Netanyahu said, but stressed that the state had to honor the court order to demolish Amona.

Dozens of police personnel gathered at the entrance to the building, and tried to enter. One was hit with an iron bar. There were reports of paint being thrown and a fire extinguisher turned on the forces. Police held up plastic shields to block the synagogue’s windows as protesters threw bottles and debris at the officers. The police initially tried to enter without helmets or other heavy protection.

Detained opponents of the evacuation of the illegal Amona outpost on a bus, in which they were placed by police. February 2, 2017. (AFP Photo/Thomas Coex)

Detained opponents of the evacuation of the illegal Amona outpost on a bus, in which they were placed by police. February 2, 2017. (AFP Photo/Thomas Coex)

Then what was reported to be tear gas billowed from the windows, and several of the protesters, hitherto determinedly staying inside the building, tried to escape the gas, with one emerging on the roof and others from a back window. The cops chased after some of them.

Police, now wearing helmets, then sped up their entry into the synagogue, sawing through window bars and smashing windows so that those inside would not be further affected by the gas.

As the protesters emerged, many were coughing and spluttering. Three police officers took each of them away from the scene. Those who had broken the law would be prosecuted, the police said.

Inside the synagogue, evidence of the violence abounded. Along with the graffiti, water, paint and some holy books were on the floor. Broken furniture was strewn around. So too were tires and debris. There were holes in some of the walls.

A Channel 2 report noted that most of the protesters seemed to be in their teens, or a little older, and said most were not Amona residents, but more likely anti-Zionist extremists, some of them students at yeshivas nearby.

Police hold up plastic shields, as protesters throw bottles and other objects at them from inside the Amona outpost's synagogue on February 2, 2017. (Screen capture: Channel 2)

Police hold up plastic shields, as protesters throw bottles and other objects at them from inside the Amona outpost’s synagogue on February 2, 2017. (Screen capture: Channel 2)

Police said 60 to 70 people were inside the synagogue.

Earlier in the day, several dozen protesters were pulled out of a home where they had holed up during the night, following the evacuation of all of the illegal outposts’ 40 families, many of them being carried out as they showed passive resistance.

The synagogue evacuation came after a day that saw police evacuate nearly the entire outpost on Wednesday, pulling tearful settlers from homes and battling protesters in low-level clashes.

As night fell Wednesday and temperatures dipped to freezing, most protesters either had been forcibly removed from the outpost, left of their own volition or were inside the synagogue and one last mobile home, with only a few milling around.

Protesters sit inside the synagogue in the West Bank outpost of Amona on February 1, 2017, as security forces prepare to evacuate the site. (Courtesy)

Protesters sit inside the synagogue in the West Bank outpost of Amona on February 1, 2017, as security forces prepare to evacuate the site. (Courtesy)

The synagogue was the largest permanent structure in the outpost, and a particularly sensitive site given its religious nature.

Wednesday’s day-long evacuation was marked by only scattered scuffles and some throwing of bricks and other materials as most protesters and settlers showed only passive resistance.

“Whoever is still around is the hard core of lawbreakers who came to create a provocation, and we are preparing to evacuate the synagogue and the home next door,” police spokesperson Lapidot said Thursday morning.

Protesters surround the Amona synagogue on the morning of the second day into the evacuation of the illegal outpost on February 2, 2017. (Yonatan Sindel/Flash90)

Protesters surround the Amona synagogue on the morning of the second day into the evacuation of the illegal outpost on February 2, 2017. (Yonatan Sindel/Flash90)

Police said early Thursday they had removed by force some 800 protesters from the hilltop enclave, as they neared the end of the operations.

On Wednesday, 24 police personnel were taken to the hospital with light injuries, mostly from the fighting, but some from hypothermia. Several protesters were also hurt and taken to Jerusalem for medical care.

Thirteen people were arrested for disturbing the peace and obstructing police work on Wednesday, police said.

Videos taken inside at least one home and the synagogue showed police looking on as protesters, some of them chained to furniture, prayed and pleaded to be allowed to stay.

In one, a weeping community leader compared the court-ordered eviction of residents to the biblical story of the sacrifice of Isaac.

There was “great desecration of God’s name” in turning children out of their beds and forcing people to give up their life’s work, he said.

Another video showed a police officer asking the remaining protesters in a house to leave in a respectable manner that honors their community and sets an example.

On Wednesday, two Torah scrolls were seen being removed from the outpost along with a carful of women who had agreed to leave. The women were part of about a dozen families who chose not to resist the eviction notice during the afternoon. However, a police officer remarked that while they were leaving without force, “at this point, no one is leaving here willingly.”

Frank, the outpost rabbi, told Army Radio that he had spent the night at the outpost after being allowed to briefly return to his home. However, no other settlers were seen attempting to return to their former homes, deemed built on private Palestinian land and ordered by Israel’s High Court to be razed by February 8.

Frank called for nonviolent resistance to continue, comparing the eviction operation to a woman being raped.

“One needs to express this protest, like a raped woman needs to cry out,” he said, repeating a comparison made a day earlier by MK Smotrich.

All the homes in the outpost but one were cleared as of midnight on Wednesday.

By Thursday morning, crews were seen entering the outpost to pack up belongings left behind by the settlers ahead of the eventual razing of the homes and other buildings.

Settlers barricaded the entrance to Amona synagogue on February 1, 2017, in an effort to delay the evacuation of the site as the West Bank outpost was cleared by security forces. (Judah Ari Gross/Times of Israel)

Settlers barricaded the entrance to Amona synagogue on February 1, 2017, in an effort to delay the evacuation of the site as the West Bank outpost was cleared by security forces. (Judah Ari Gross/Times of Israel)

The Amona evacuation began Wednesday as unarmed police in blue sweatshirts and black baseball caps made their way up the hill around midday. On the hilltop, hundreds of nationalist youths erected makeshift barricades out of smashed tiles, rusty metal bars and large rocks, as well as burning tires and furniture, to slow their advance.

Some protesters hurled stones, bottles and bleach at police, but most others resisting the eviction order only passively. However, emotions ran sky-high, with protesters and evacuees yelling at officers or pleading with them to refuse the orders.

A man screaming at police (unseen) from a house during the evacuation of the illegal outpost of Amona, on February 1, 2017. (Miriam Alster/Flash90)

A man screaming at police (unseen) from a house during the evacuation of the illegal outpost of Amona, on February 1, 2017. (Miriam Alster/Flash90)

One border police officer at the scene Wednesday said he would not take part in the evacuation. He was led away by a colleague as protesters ran alongside, praising him.

“This is a dark day for us, for Zionism, for the state and for the great vision of the Jewish people returning to its homeland,” Avichay Boaron, a spokesman for Amona, told Channel 2 TV.

Israeli settlers stand on a rooftop during an evacuation operation at the illegal Israeli outpost of Amona on February 1, 2017. (Miriam Alster/FLASH90)

Israeli settlers stand on a rooftop during an evacuation operation at the illegal Israeli outpost of Amona on February 1, 2017. (Miriam Alster/Flash90)

About 3,000 security personnel were deployed to the operation; about 1,000 people — residents and their supporters — were estimated to be at Amona when the evictions began.

Netanyahu announced Wednesday night that he had ordered the creation of a new settlement to replace Amona, the first official new Israeli community in the West Bank in some 25 years.

The announcement came hours after the High Court shot down an agreement for most of the settlers to move to an adjacent plot of land, after the land’s owner came forward.

The deal, struck last month, staved off an earlier evacuation that had also threatened to be met by violence.

A man holds Israeli flag as Israeli security forces gather ahead of the evacuation of the illegal outpost of Amona, on February 1, 2017. (Miriam Alster/Flash90)

A man holds Israeli flag as Israeli security forces gather ahead of the evacuation of the illegal outpost of Amona, on February 1, 2017. (Miriam Alster/Flash90)

After over a decade of delays and legal wrangling, the High Court ruled in December 2014 that Amona, which lies east of Ramallah, was built on private Palestinian land and must be demolished. Nine homes in the adjacent Ofra settlement were also due to be demolished.

Residents of the neighboring Ofra settlement announced that Thursday would be a “public fast day.”

The fast — a Jewish sign of mourning — is being called “over the destruction of houses and communities in the Land of Israel, a merciless and unjust [High Court] ruling, and the wantonness of elected officials.”

The Associated Press contributed to this report.