UNITED NATIONS - UN Secretary-General Ban Ki-moon is concerned a stalemate in the peace process between Israel and Palestinians is reaching the point of no return for a two-state solution.

"The time has come for Israelis, Palestinians and the international community to read the writing on the wall: The status quo is untenable," Ban wrote in an opinion piece published in the New York Times late on Sunday. "Keeping another people under indefinite occupation undermines the security and the future of both Israelis and Palestinians."

The Palestinians want an independent state in the West Bank, Gaza and East Jerusalem - areas Israel captured in a 1967 war.

Israeli Prime Minister Benjamin Netanyahu slammed Ban last week, saying he gave a "tailwind to terrorism" after the secretary-general put some of the blame on Israel for four months of stabbings and car rammings by Palestinians.

Ban, who will step down at the end of 2016 after 10 years as UN chief, had told the UN Security Council that it is "human nature to react to occupation."

"I will always stand up to those who challenge Israel's right to exist," Ban said in the Times, "just as I will always defend the right of Palestinians to have a state of their own. That is why I am so concerned that we are reaching a point of no return for the two-state solution."

Meanwhile, Israel blocked non-residents from Ramallah on Monday after a checkpoint shooting wounded three soldiers, keeping commuters out of the West Bank city where the Palestinian Authority is based.

The unusual move also applied to foreigners, although United Nations officials, international NGOs and diplomatic staff were being allowed in, diplomatic and UN sources said.

Palestinians seeking to leave Ramallah were also undergoing security checks, leading to frustration in lengthy queues.

"In accordance with situation assessments following yesterday's shooting attack in Beit El, security measures have been taken in the area and only residents of Ramallah are allowed to enter the city," a military spokeswoman said.

Sunday's attack saw a Palestinian who had worked as a guard for the attorney general's office in Ramallah open fire at a checkpoint outside the city, wounding three Israeli soldiers before being shot dead.

It was the latest in four months of Palestinian knife, gun and car-ramming attacks targeting Israelis. Most of the attacks have been stabbings, though shootings have occasionally occurred.

The military spokeswoman said on Monday a decision on when to lift the measure would depend on security assessments, with Israel seeking to halt the wave of attacks.

It was not clear when the last time such a move had been taken by Israel, though heavy restrictions were put in place during the second Palestinian intifada, or uprising, between 2000 and 2005.

Sunday's shooting marked at least the second time a Palestinian security officer had been implicated in an attack in the current wave of violence.

The checkpoint where it occurred, regularly used by diplomats, journalists and humanitarian workers, was closed on Monday morning, an AFP journalist reported.

A number of other roads connecting Ramallah with the northern West Bank were also closed or restricted, although checkpoints near Jerusalem were open.

Later in the day, it appeared that enforcement of the measure varied between locations.

A large number of Palestinians, aid workers and diplomats commute to Ramallah for work or other reasons on a daily basis.

While diplomats were not directly impacted, "the travel restriction on Palestinians is having an effect in terms of our ability to engage", one Western diplomat said.

"A number of meetings have been called off because Palestinian interlocutors have not been able to get to the meeting site."

Palestinians queueing to leave Ramallah said they considered the measure to be punishment for Sunday's attack.

One woman in her 30s waiting in a taxi gave her name as Aline and said she was missing a court date in Nablus in the northern West Bank.

"The question is until when this will happen?" she asked.

"Every time someone has a gun and goes to shoot the Israeli army? Neither the (Palestinian) president is harmed or anyone else. Only the people are harmed."

Violence since October has killed 25 Israelis, as well as an American and an Eritrean, according to an AFP count.

At the same time, 161 Palestinians have been killed by Israeli forces, most while carrying out attacks but others during clashes and demonstrations.

The checkpoint shooting was one of two attacks on Sunday.

Later in the day, an attempted car-ramming occurred at a military checkpoint in the West Bank north of Jerusalem, with the attacker shot and taken to hospital for treatment, Israel's military said. No Israelis were reported wounded.

On Monday morning, a 17-year-old Palestinian was shot dead after trying to stab soldiers near the Jewish settlement of Salit in the West Bank, Israel's army said. Salit is near Israeli territory, not far from Tel Aviv.

Some analysts say Palestinian frustration with Israel's occupation of the West Bank, the complete lack of progress in peace efforts and their own fractured leadership have helped feed the unrest.

Israel blames incitement by Palestinian leaders and media as a main cause of the violence.

Many of the attackers have been young people, including teenagers, who appear to have been acting on their own.