Five years ago a peace treaty ended two decades of civil war in Sudan. It envisaged free elections which would prompt "democratic transformation". These are due to take place in 10 days' time. What they have created instead, according to the International Crisis Group, is a manipulated census, crooked voter registration, gerrymandered electoral districts and bought tribal loyalties.

On Thursday night the five political parties that constitute the main opposition said they would boycott the poll, a day after south Sudan's leading party, the former rebel Sudan People's Liberation Movement (SPLM), withdrew its candidate Yasir Arman. If the opposition parties remain out of the race, the election, the first multi-party contest since 1986, would lose its credibility. President Omar Hassan al-Bashir needs that legitimacy, not least to fend off indictments on charges of crimes against humanity in Darfur by the international criminal court. After some western election observers advised the government to postpone the vote, Bashir threatened to cut their fingers off. He also threatened the SPLM that if they withdrew completely from the vote, he would torpedo their forthcoming referendum on independence, which is another requirement of the 2005 peace treaty.

The referendum is much more important to south Sudan and the SPLM than the national elections. The north-south war killed more than 2 million people. If the referendum is blocked and both sides continue to rearm, it is not difficult to imagine a reprise of the war, which this time would end in the capital Khartoum.

An unholy trade-off is thus in the making, allowing Bashir to have his election, if he lets the SPLM hold theirs. For this reason, the SPLM's election boycott was a partial one. They withdrew their presidential candidate and their local candidates in western Darfur, where the alleged rigging by Bashir's National Congress party (NCP) has been worse. But the SPLM said they would contest elsewhere.

The NCP registered Arabs, nomads, incomers from Chad and Niger – everyone they could lay their hands on, bar the 2.6 million Darfuris living in refugee camps. Opposition parties said yesterday that they could review their decision to boycott if the government agreed to reform the national elections commission. Given a brutal choice between a national election which Bashir and the NCP will win, and averting another war between north and south, the US Sudan envoy Scott Gration, who has flown into Khartoum, may well take the pragmatic course of action. That still leaves the problem of Bashir, an indicted war crimes suspect, the NCP and their unfinished conflict in Darfur.