Half a year ago, when a former tank commander named Ibrahim Babangida seized control of Africa's most populous country, Nigeria seemed nearly impossible to lead.

Its 100 million inhabitants, having weathered six military coups and eight heads of state in the preceding 25 years, were contemptuous of the last civilian government -- overthrown in December 1983 -- which had wasted and stolen billions in oil revenue.

Nigerians resented the last military government -- overthrown by Maj. Gen. Babangida -- which had scolded them to be "disciplined" and locked up those who complained too loudly. The oil-dependent economy that Babangida inherited was hobbled by $18 billion in foreign debts. The world oil glut in the previous five years had cut government revenues in half. Unemployment was surging; inflation was 40 percent a year and rising.

If this were not enough, things got worse. Two months ago, Babangida's fledgling government put down a coup attempt led by the Air Force. And last month, the bottom fell out of the price of Nigerian crude, source of 94 percent of the country's foreign exchange.

Yet, in the face of all the bad news, the new military leader has garnered widespread public support while pushing Nigeria toward painful economic retrenchment. Babangida, who has taken the title of president, has managed this feat with a surprisingly unmilitary style of leadership. He has refrained from making major policy decisions before giving Nigerians a chance to tell him what they think.

"His public relations have been amazing," said a senior western diplomat here. "After the corruption and abuses of the civilian government, the common man accepts a military government. But he assumes that military governments don't listen. Now Babangida listens."

Nigerians pride themselves on their freedom of expression. That freedom is exercised here with an exuberance and at a decibel level rarely heard on the continent. There are 16 major daily newspapers in the country and several major news weeklies. Political analysts and diplomatic observers here say Babangida understands the Nigerian penchant for expressing opinions and appears willing to bend his policies to accommodate it.

Babangida first used his technique of letting the public hash it out last fall when he appointed a panel of experts and called for a national debate on whether Nigeria should accept a $1 billion bailout from the International Monetary Fund.

Before the debate began to rage in the papers, in taxicabs and on street corners, Babangida was thought to be leaning toward accepting the loan, which would have allowed Nigeria to reschedule its debts while implementing a number of politically unpalatable economic reforms.

But when Nigerians made it clear that they saw an IMF bailout as an insult to national pride, Babangida turned down the money. He did not, however, reject the IMF's advice. According to External Affairs Minister Bolaji Akinyemi, Babangida, after giving Nigerians their say, was able to sell the public on a package of stringent economic reforms that would have been politically unacceptable if it had been linked publicly to the IMF.

The Babangida budget package, announced at the end of last year, unilaterally declared that Nigeria would use no more than 30 percent of its export earnings to pay foreign debts. The challenge to the international financial community, however, occasioned surprisingly little criticism because Babangida's economic reforms called for an IMF-style restructuring of Nigeria's economy. Here in Nigeria, however, Babangida carefully sold the reforms as "home-grown to solve our problems and chart a new path for our future."

"There were no riots here because the reforms are seen as home-grown," said Akinyemi.

Nigerians are accustomed to buying cheap, government-subsidized petroleum products. The first and perhaps most painful effect of Babangida's budget measures was to eliminate most of the fuel subsidies. Last month, there was a doubling in the price of gasoline and diesel fuel. Transportation costs for commuters in Lagos also increased sharply and there was widespread grumbling here about the soaring cost of living.

But Babangida, having let the public have its say, was not blamed. "The guy is perceived as having responded to public sentiment, so he is not getting the heat for the higher cost of transportation," said a senior western diplomat.

Babangida, 44, was the number three general in the last military government, led by Maj. Gen. Mohammed Buhari. But within hours of seizing power, he distanced himself from the aloof, authoritarian style that had marked Buhari's 20 months in power.

The new leader abolished a decree that forbade publication of anything that embarrassed public officials. He released hundreds of persons who had been held in prison without formal charges. He demonstrated a knack for political symbolism, shunning an umbrella and standing outside in a tropical downpour with his soldiers during an independence day celebration. He capitalized on longtime friendships with Nigerian publishers and editors, granting scores of interviews and reaping enthusiastic, adulatory coverage.

For 16 of its 25 years of independence, Nigeria has been led by military governments. Civilian governments have proved either ineffectual (such as the first civilian regime, ousted in 1966) or corrupt (such as the government of Shehu Shagari, ousted two years ago). Nevertheless, democratic government remains the ideal of most Nigerians, according to political analysts here, and military governments are consistently pressured to move toward civilian rule.

On Jan. 20, Babangida promised a return to a "participatory, political system," but only after a national debate and a study by an expert commission. The move received widespread support in the Nigerian press and among many of the country's political aspirants, despite the fact that Babangida, in asking for public ideas that would "smooth" the transition to civilian rule, had decreed himself four more years in power. He said the transition would not be allowed to take place until October 1990.

Late last month, Babangida again appointed a commission and called for a national debate to calm a storm of protest after Nigeria joined the Organization of the Islamic Conference. The group, made up of 45 countries, most of them located in the Persian Gulf region and northern Africa, was established "to promote Islamic solidarity," according to its charter.

Christians, estimated to be about 35 percent of Nigeria's population, were outraged by the move. In an interview here, Roman Catholic Archbishop Anthony Okogie called it "a trespass and a slap on our office." Other Christian leaders warned that joining the Islamic organization could trigger violence in Nigeria, a country divided north and south along religious and ethnic lines.

Babangida, a Moslem from Niger State, a middle region that is not identified with doctrinaire religious sentiments in the Moslem north or Christian south, named both Christians and Moslems to examine the "full implications" of membership in the Islamic Conference. As before, he appears to be seeking public participation to cool what one of his senior advisers calls "our hottest potato."

Babangida's inclination to consult the public and his knack for image-making, however, cannot solve Nigeria's severe economic problems. In the coming year, if oil prices remain below $20 a barrel (the price last Friday was $18.25), economists here estimate Nigeria will be unable either to pay its debts or buy essential imports.

International economists here also say Babangida has delayed implementing announced reforms that would force currency devaluation and get rid of Nigeria's corrupt system of import licenses. Western diplomats say that these changes, by undermining the livelihood of many of Nigeria's richest and most influential people, would mark an unprecedented shake-up in the country's power structure.

"Babangida is saying the right thing," said a senior analyst for a multilateral lending agency here, "but what it will come down to in the next few months is this: does he have the capacity to do it?"

Yet after six months in charge of a coup-prone country caught in its most severe economic tailspin, Babangida continues to receive enthusiastic reviews both inside the country and from western diplomats representing countries with billions of dollars in loans and investments in Nigeria. Echoing the sentiments of the major creditor countries here, one senior diplomat concluded, "Babangida is pushing the political limits of reform about as hard as he can, and still remain popular."