Dhaka: Bangladeshis voted on Monday in an election that returns the country to democracy after two years of emergency rule and tests whether it has moved beyond a history of street violence between supporters of rival parties.

Polls officially closed at 4pm (1000 GMT), although officials said those still in line would be allowed to vote, and the process was generally peaceful. There was a festive air in the sprawling capital Dhaka. Most motor traffic had been banned for a public holiday called for the vote.

Starting afresh: (top left) Former prime ministers Sheikh Hasina and (top right) Begum Khaleda Zia are pitched against each other for the crucial general elections in Bangladesh, which marks the return of democracy to this troubled nation after two years of emergency. (Below) Women stand in a queue to cast their votes in Dhaka on Monday. Saurabh Das / AP

However, both leading candidates have pledged strong action to crack down on violent extremists, as well as made populist promises to contain prices and promote growth in a country where 45% of the people are below the poverty line.

An alliance led by former prime minister Sheikh Hasina of the Awami League has the edge in the vote for 300 parliament seats, most observers say.

Others predict neither she nor rival and former prime minister Begum Khaleda Zia will win an outright majority in a country where parties are based more on personality than rigid ideologies.

Counting started on Monday evening. Significant indications of trends are not expected before the early hours of Tuesday.

“We have waited so long...but (are) feeling good the election is held at last," Hasina said after casting her vote.

Khaleda, leader of the Bangladesh Nationalist Party, or BNP, said: “If the election is free and fair, Inshallah (God willing) we will win and form the next government."

Cheerful voters waited up to an hour in line to cast their ballots, while others who were through the exercise, stayed on the streets to chat. Men and women, many of the latter in brightly coloured saris and head scarves, voted at separate sites.

Chief election commissioner A.T.M. Shamsul Huda said various anti-cheating measures put in place ensured a credible polling.

“This time the mood is different," Mariam Faruqui said as she waited in the line at a Dhaka polling station in a women’s school.

“Other times there were very (many) illegal votes" and some people were scared to support the candidates they really wanted, the 50-year-old gynaecologist said.

Elections in the past have been marked by widespread fraud and violence, and party supporters have often taken to the streets for protests, strikes and confrontations ahead and after the votes.

The outgoing army-backed interim government took over amidst such political violence in January 2007 and cancelled an election due that month, making the Monday poll the first in seven years.

Voters across the country streamed to polling booths.

“People are coming to cast their ballots spontaneously. I had no problem at all," said Shilpi Das, 35, as she emerged from voting in north-eastern Sylhet city.

Amid hopes for a peaceful transition to democracy and stable government to attract investment and aid, the broad Dhaka Stock Exchange price index rose nearly 4% to 2,258.39 on Sunday.

The government deployed 50,000 troops, 75,000 police personnel and 6,000 members of its elite Rapid Action Battalion along with other auxiliary forces for security.

About 200,000 local and 2,000 foreign monitors were at the polling centres to check procedures.

Not everyone was impressed.

“There are too many observers. Some of them are biased," said Abdullah Al-Noman, a former minister and a BNP candidate in the port city of Chittagong. Such comments, and Khaleda implying that if she lost, the vote would be unfair, could set the stage for post-election unrest.

That could get in the way of a new government tackling such challenges as reducing corruption and improving the economy, and prompt the military to step in, as it has before, to restore order.

Indeed, army chief general Moeen U. Ahmed’s remark after voting that the military would “provide support to the elected government as much as they did for the interim authority", might be seen as hinting the new leaders should be prepared to have someone looking over their shoulders.

Hasina and Khaleda have alternated in power for 15 years through to 2006. Critics say they barely dented Bangladesh’s problems, in a large measure because of protests, strikes and violence linked to their parties when out of office.

Some voters expected Hasina and Khaleda to avoid such tactics after this vote, and try to follow through on promises. But rickshaw mechanic Mohammad Mudasser had doubts. “I don’t think this vote will give us anything new ... They forget their pledges after the election," he said.