Image caption Brig Gen Razzaq said some of those involved in the plot would soon appear in court

The Bangladesh army says it has foiled a coup planned against the government of Prime Minister Sheikh Hasina.

Military spokesman Masud Razzaq said in a statement that the attempt had been thwarted by the "whole-hearted efforts of army soldiers".

He said the officers planning the coup were in active military service and had "extreme religious views".

Bangladesh has a history of military governments. The army ran the country for 15 years until 1990.

Sheikh Hasina took over power from a military-backed caretaker government in early 2009. Officials say she has since faced threats from Islamists and other radical groups.

The BBC's Ethirajan Anbarasan in Dhaka says that this could prove to be the first major challenge to the government of Sheikh Hasina since the revolt by Bangladeshi border guards in February 2009.

'Heinous conspiracy'

Analysis Though rumours had been circulating about a possible coup for weeks, many in government dismissed the idea, saying the army had no appetite for it under the present circumstances. But it may have underestimated the divisions in the army and the country. In recent years, certain government policies, such as its attempts to push Bangladesh in a more secular direction and its closeness to neighbouring India, have proved divisive. Islamist groups openly challenged the government and it appears as if the discord spread to elements of the army. Though the military top brass may not be keen for a takeover right now, the latest incident shows how some disgruntled mid-level officers have the capacity to get together and rattle the establishment.

"A band of fanatic officers had been trying to oust the politically established government. Their attempt has been foiled," Brig Gen Razzaq said.

He said that "specific information has been unearthed" that some officers in military service - who had been identified - were involved in the December conspiracy.

He said that a group of up to 16 hardline Islamist military officers - including at least two retired officers - were involved.

Some had been detained, he said, and would be presented before a military court.

Brig Gen Razzaq said that the "heinous conspiracy" was instigated by Bangladeshi conspirators living abroad.

In 2009, Bangladeshi paramilitary forces staged a revolt soon after Sheikh Hasina took office. It began in Dhaka and spread to other cities.

More than 70 people were killed, including 51 army officers, before it was crushed.

Correspondents say that last year's changes to the constitution - to make it more secular - by the government of Sheikh Hasina angered hardliners, even though Islam was retained as the state religion.

The move sparked a series of angry demonstrations by Islamist activists.