By Matthew Price
BBC News, Jerusalem
Just a fraction of the Palestinians living in East Jerusalem will be allowed to vote in the city in Palestinian elections this month.
The few allowed to vote in the city will be chosen by a kind of lottery
Just 6,300 residents will be allowed to vote in the city - the remainder, an estimated 109,000 - will have to travel outside the city boundaries to vote.
Israel has occupied East Jerusalem since the 1967 war and has imposed its laws on the Palestinians living there.
Jerusalem is the heart of the conflict between Israelis and Palestinians.
The Palestinians want East Jerusalem to be their capital. Israel says that it will never give up the eastern side of the city that it captured in 1967.
First come first served
The issue of whether to allow Palestinians to vote in East Jerusalem is a crucial one. It serves as an illustration of who currently controls a part of the city which is considered under international law to be occupied by Israel.
Palestinians estimate that there are about 115,000 East Jerusalem residents who are eligible to vote.
Under a deal between the two sides, just 5.5% will be allowed to cast their ballot in East Jerusalem.
There is no time to decide on areas from where the 6,300 will be chosen, so instead a sort of lottery system is being set up.
Over the next few days election officials will head out to different parts of East Jerusalem then they will issue tickets to voters on a first come first served basis.
Voters who are chosen will then go to one of six post offices in the city. There a post office official will hand them a ballot paper. There is no polling booth. The completed ballot paper is placed in a box, and later sent to Palestinian election officials for the votes to be counted.
It is - the BBC was told by one source close to the negotiations - the only way to allocate the votes at this late stage.
But what happens to the estimated 109,000 East Jerusalem Palestinians who cannot vote in this way? Special polling stations have been set up for them outside the city boundaries as defined by Israel.
If they wish to vote, they must travel through checkpoints - which Israel has said it will ease. The journey to get around the barrier Israel is constructing around Jerusalem can be a time-consuming and difficult one, and the election is being held on a work day. It may be that many East Jerusalemites decide not to vote.
Israel has banned Hamas from campaigning in East Jerusalem
The arrangement is designed as a compromise. It allows the Palestinians to say that they are exercising their right to vote on Palestinian soil. It allows Israel to say that East Jerusalem's Palestinians are voting by post from a foreign country.
One well placed Palestinian source called the arrangement "farcical". He claimed Israel had deliberately delayed meeting the Palestinians to discuss the arrangements for months, until the last minute, and this had led to a situation which did not meet international standards.
Israel agreed a few days ago to allow voting to go ahead in the city. An Israeli source said that Israel is doing all it can to facilitate the elections, and pointed out that the current arrangements had been successfully followed in two previous elections.
A source in the European Union election monitoring mission here said the agreement is "not good" but added that at least it allows some voting in East Jerusalem.
And that may well be the important thing for those who want this election to go ahead. The Palestinian leadership had threatened to postpone the election if Israel did not allow voting in East Jerusalem.
This agreement at least meets that demand.