Troops are patrolling the streets of Dhaka

State media reported his departure just hours after he had announced a state of emergency and a curfew in the country.

Mr Ahmed then went on television to say that the 22 January vote was being put back. "It's not possible to hold the elections on schedule," he said.

A major political alliance says the vote is being rigged. Weeks of violence have left more than 40 people dead.

'Fair vote'

Mr Ahmed said he would stay on in his largely ceremonial post of president. Nine of 10 members of his caretaker administration are also reported to have resigned.

We need a flawless voter list to ensure that the elections are free, fair and credible

President Iajuddin Ahmed

Analysis: Will democracy win out?

The president said one of his advisers, Fazlul Haque, would serve as head of the caretaker government until he had named a replacement.

"I will, in a couple of days, appoint a new interim leader to hold an election in which all parties will be able to participate," he told the nation.

Mr Ahmed did not specify a new general election date, but made clear there should be key changes before the vote is held.

"We need a flawless voter list to ensure that the elections are free, fair and credible."

The Awami League party and its allies announced last week they were boycotting the vote because they said it was not going to be fair.

Amending the electoral register was a central demand, as was Mr Ahmed's removal as chief adviser to the caretaker government.

The alliance said the announcement was a "victory for the people".

It has led mass demonstrations which have at times brought the country to a standstill in recent months. There have been violent clashes between police and supporters of rival political groupings.

Curfew

A late night-early morning curfew (2300-0500 local time) was announced by state media earlier on Thursday.

By admitting that the voter list had errors, and quitting as head of the interim government, he has in fact accepted our main demands

Awami League spokesman Abdul Jalil

State television said the curfew affected more than 60 cities and towns across Bangladesh. as well as the capital, Dhaka.

Under the state of emergency news broadcasting by private television channels is suspended. The media are not allowed to criticise the the government or its policies.

All political activities are also banned.

Hours earlier, the UN and the EU said they were suspending assistance for the election, sending a strong signal that the vote should be postponed.

There have been weeks of violent protests over the vote

The Awami League has long alleged electoral bias in favour of its bitter rival, the Bangladesh Nationalist Party (BNP), which left office in October. The BNP rejected the allegations of bias and had said it would take part in the vote.

The state of emergency raised concern in a country which has experienced periods of military rule and coup attempts since independence from Pakistan in 1971.

Under the Bangladesh constitution the caretaker government must organise elections within 90 days - Thursday's developments take the country into uncertain and uncharted territory.