Bangladesh's Army chief, who led the early-morning overthrow of the four-month-old elected government of that desperately poor South Asian nation, announced in a radio address yesterday that the bloodless coup was designed "to protect the freedom of the nation."

Declaring martial law in a speech monitored in Calcutta, Lt. Gen. H.M. Ershad said the civilian government had "completely failed" to cleanse Bangladesh of rampant corruption and to attack the economic problems crippling the densely populated nation of 90 million.

The swift takeover climaxed a power struggle in which the armed forces demanded a constitutional role in the government, while the 75-year-old newly elected president, Abdus Sattar, insisted the military's only legitimate role was to defend the nation's borders.

But the coup took place with the apparent blessing of Sattar, who said in a brief radio address that "military rule has become a necessity." Later, United News of India reported that he had been placed under house arrest by the new martial-law government.

The most pressing problems of the faction-ridden nation, where annual per capita income is about $100, include a food shortage that caused large-scale increases in the price of rice, the staple most people rely on for subsistence-level diets; the cutoff of an International Monetary Fund loan eight months ago on the grounds that government spending had run amok, and a worsening international climate for aid to poor nations. Bangladesh depends on such aid for survival.

Ershad also said that Sattar had refused to honor a campaign promise to purge from his Cabinet ministers known to be corrupt.

"The people expected the Army to come to their aid," said Ershad in the radio speech, in which he dissolved the Parliament and the constitution. He promised that new elections would be held soon, but indicated that the country's new civilian ruler would take direction from the military.

There was widespread speculation that Ershad would try to fashion his government on Indonesia's. This speculation was fueled by reports that Ershad had sent two generals to Jakarta this month to observe the military government there.

Bangladesh has been teetering on the brink of a military takeover since the May 30 assassination of the nation's charismatic president, Ziaur Rahman, in what has been described as a mutiny by maverick Army officers.

The military was widely expected to take power immediately. Instead, Ershad helped stabilize the country and elections took place Nov. 16 in which Sattar--with the blessings of the military--won an overwhelming victory. He defeated by a vote of nearly 3 to 1 the opposition Awami League party, which had led the fight for Bangladesh independence from Pakistan.

A confrontation erupted between Sattar and Ershad within a day of the election. The new president, a former chief justice, challenged the military's demand for an undefined constitutional role in running the country.

Relations between the two men worsened to the point where, by last month, people no longer talked about whether a military takeover would take place, but when it would happen.

With communications and transportation links cut yesterday, it remained unclear exactly what triggered the Army's predawn move. But observers in New Delhi speculated that the precipitating factor was Sattar's surprise appointment this week of Mohammadullah, a former president under an Awami League government, to the post of vice president. Because of Sattar's fragile health, Mohammadullah's prospects for becoming acting president were considered excellent.

Ershad, 52, named the chiefs of the Navy and Air Force as deputy martial-law administrators. He also divided the country into five martial-law zones. Observers in New Delhi noted that he seemed to be following the same pattern as Zia did in 1975 when he took power in a military coup.

There were no reports of opposition to the takeover, and troops were reported patrolling the streets of all of Bangladesh's major cities.

Sattar's presidency had begun on an optimistic note. He made a number of decisive moves, including breaking threatened bankers and teachers strikes, and gave the impression that he would be a strong, active president who because of his age would be less influenced by the political ramifications of his moves. Once he took office, however, this expected strength failed to materialize, and the country appeared to go through months of drift and vacillation.

As a result of the continued instability, senior bureaucrats complained that they had gotten no direction from elected political leaders since Zia's assassination.