Sudan's first multiparty national election in 18 years ended quietly today after 12 days of orderly voting.

While the voting itself went smoothly, Sudan's transition from military to civilian rule appeared threatened both by an unprecedented escalation of rebel fighting in the south and by the arrival of a Libyan delegation demanding that Sudan "merge" with Libya.

That proposal's reception will likely depend on whether moderate or fundamentalist forces dominate the civilian government to be formed after the election.

Between 4 million and 4.5 million voters cast ballots in about 28,000 polling stations, according to the Sudan News Agency. Given that Sudan has only 1,200 miles of asphalt road and all but nonexistent telecommunications, results are not expected before Wednesday.

The election was cancelled in more than half the 68 constituencies of rebel-controlled southern Sudan, where about one-quarter of the country's 21 million people live.

John Garang, leader of the 15,000-man Sudanese People's Liberation Army, had vowed to stop all voting in the south and to reject any winner of a "partial" election -- though he has named negotiators to meet with the winners.

Since the voting started, a senior western diplomat here said the rebels have been more active than at any time in their three-year history.

"The rebels obviously want . . . the strongest possible negotiation position," the diplomat said.

A government official said today the rebels engaged government soldiers in heavy fighting this week in several towns in the Eastern Equatoria region, forcing cancellation of voting in five constituencies.

The rebel military threat pushed the Khartoum government last month into seeking military help from neighboring Libya. That assistance, which U.S. officials have termed a reversal of Libya's earlier help to the southern rebels, appears to have given Col. Muammar Qaddafi's government considerable access in Khartoum and new-found leverage in influencing Sudanese policy.

An official in the Sudanese Ministry of Foreign Affairs said the 28-member delegation came to Khartoum this week to seal a "unity" agreement in exchange for the loan to Sudan of two Soviet-made Tupolev 22 bombers.

The Libyan-piloted planes were used in attacks last month against rebel-held towns in the south.

Two Sudanese familiar with the demands made this week by the Libyan delegation, which met with Sudan's military leader, Gen. Abdel Rahman Swar-Dahab, and leaders of political parties contesting the election, said the Libyans want Sudan to renounce diplomatic relations with neighboring Egypt and Chad, and the United States.

Sudan is the largest recipient of U.S. military and economic aid in sub-Saharan Africa. It also gets military assistance from Egypt and has friendly relations with Chad, whose government has been fighting a Libyan-supported rebel army.

Sudanese government and political leaders reportedly tried this week to mollify the Libyans while saying that a "unity" agreement should be postponed until the new government takes power.

Swar-Dahab's government, which came to power last April after a coup toppled the 16-year-old regime of President Jaafar Nimeri, has promised to turn over power to civilians at the end of this month.

The escalating war in the south and the Libyan demands in Khartoum have complicated the formidable problems facing the coalition government expected to emerge from the elections.

More than 30 parties fielded 1,000 candidates for 301 seats in a National People's Assembly, which will write a constitution and pick a government. It is widely predicted here that the largest number of seats will be won by the moderate Umma Party, and its leader, Sadiq Mahdi, will become prime minister.

Mahdi, great-grandson of a celebrated religious leader whose army routed the British from Khartoum in 1885, is considered by western diplomats and many moderate Sudanese as having the best chance to negotiate peace.

Mahdi has vowed to abrogate harsh Islamic sharia laws introduced under Nimeri in 1983. Under these laws, which are hated in the predominantly Christian and animist south, about 300 Sudanese had limbs amputated for petty theft.

Elimination of these laws and the creation of a secular state are two major rebel demands.

But the new government's flexibility depends on the electoral showing of the hard-line fundamentalist National Islamic Front. Its leader, Hassan Turabi, a charismatic lawyer, helped persuade the Nimeri government to adopt sharia.

"If Turabi's Islamic Front does well in the elections, there will have to be some form of sharia," said a western diplomat here. "If not, Sadiq Mahdi will have a relatively free hand to negotiate with the south."