Bangladesh's main Islamist party has broken election rules, jeopardising its involvement in next year's poll, the high court has said.
Jamaat-e-Islami must amend its charter and re-apply for registration if it is to contest the polls, a lawyer for the election commission said.
Senior Jamaat leaders who opposed the country's 1971 separation from Pakistan are being tried on war crimes charges.
A series of rulings against Jamaat have led to violent protests in Bangladesh.
A panel of judges had been considering a petition which complained that Jamaat-e-Islami, as a religion-based party, did not believe in the independence and sovereignty of Bangladesh.
Lawyers argued that provisions of Jamaat's charter were against Bangladesh's constitution. The high court ruled in favour of the petition.
Party remains legal
Responding to Thursday's verdict, the Bangladeshi election commission, which is in charge of preparations for the poll due to take place next January, confirmed that Jamaat would be able to continue its political activities.
Shahdeen Malik, a lawyer for the commission, told AFP news agency: "If it amends its charter to bring it in conformity with the constitution and reapplies for registration, it can be re-registered," he added.
Four party leaders have this year been sentenced to death for murder, mass murder, rape and religious persecution.
In a report released on Thursday, Human Rights Watch said violent unrest sparked by a series of controversial court rulings since February had left at least 150 people dead.
Most of the victims were protesters, HRW said. But at least 12 members of the security forces were among those killed, the rights group added.
"With... more war crimes verdicts ahead, the risk of further violence is high," said HRW spokesman Brad Adams.