Jerusalem (CNN) -- Israeli security forces opened fire on a group of Palestinians at a West Bank refugee camp early Monday, killing three, according to Palestinian medics.
Israel Defense Forces confirmed the shooting, but said two people had died in what the military described as a case of self-defense.
Security forces had to put down a potentially deadly attack from a violent Palestinian mob, an IDF spokesman said.
Palestinian legislator Dr. Mustafa Barghouti said the shooting was an act of aggression. He accused Israel's military of assaulting private homes and wounding Palestinians inside their own four walls.
The Israeli version
Under the cover of darkness, Israeli security officers detained a terrorism suspect southeast of Ramallah, when hundreds of Palestinians began rioting, the IDF said.
They hurled stones, endangering the officers' lives.
The Israelis called for help from IDF troops nearby tasked with securing their operation. They found it necessary to apply the method of last resort.
"A large violent crowd such as this that significantly outnumber security forces leave no other choice but to resort to live fire in self-defence," said IDF spokesman Peter Lerner.
The Palestinian account
That's not how it happened, Palestinian sources said.
Palestinian officials and witnesses at the scene said Palestinians threw stones from rooftops only after Israeli troops raided the camp during an arrest operation.
Israeli special forces attacked residences at the Qalandia refugee camp, Barghouti said. Then a "very big number" of army troops followed in behind them "and started shooting sporadically."
"They transformed Qalandia camp into a war zone," he said.
The Israeli troops hindered ambulance workers who were trying to tend to the wounded, which cost the third victim his life, he said.
Israeli forces arrested two people, Barghouti said. One of them was a former prisoner whom Israel had released in a group of more than 1,000 in 2011 in exchange for the safe return of Israeli soldier Gilad Shalit.
Shalit was abducted and held by Hamas in 2006.
Barghouti said the shooting, and also plans to expand Jewish settlements on the West Bank, undermine current peace talks between Israeli and Palestinian leaders, which started in mid-August.
The issue of settlements derailed the last round of direct talks in 2010. They resumed this year after strong encouragement by U.S. Secretary of State John Kerry.
As a gesture of goodwill, Israel began releasing more than two dozen Palestinian prisoners on the eve of new peace talks. Some of them had been held for more than 20 years.
At the same time, Israel said it would forge ahead with a plan to build more than 1,000 housing units in East Jerusalem, which the Palestinians hope will be the capital of their future state.
Israel considers East Jerusalem and Qalandia camp part of Greater Jerusalem, the United Nations says. The camp for Palestinian refugees is under Israeli control.
Children make up the bulk of its 11,000 inhabitants, the U.N. says.
CNN's Mike Schwartz and Kareem Khadder reported from Jerusalem; Ben Brumfield wrote and reported from Atlanta.