Jaafar Nimeri remained in power so long that he gave every appearance of believing himself invulnerable.

A career Army officer, he seized power with the aid of the Communists in 1969 and, as the years went by, he made and broke alliances with almost every other political party in Sudan.

Over the years he survived numerous attempted coups as economic and political conditions deteriorated. This time the accumulation of errors caught up with him, and not even the backing of the United States could save him.

Jaafar Mohammed Nimeri was born in Omdurman on Jan. 1, 1930, into a middle-class family. At 20, he entered the Khartoum Military Academy, graduating in 1952, the year Gamal Abdel Nasser and his "Free Officers" took power in Egypt.

Nimeri and other young officers later formed an organization similar to Nasser's, and Nimeri was arrested by the military government of Lt. Gen. Ibrahim Abboud.

The civilian government that followed the overthrow of Abboud in 1964 kept Nimeri abroad on training assignments, including a course at the U.S. Army Command and General Staff College in Fort Leavenworth, Kan.

Nimeri and his military academy classmates staged their coup on May 25, 1969. Initially supported by the Sudanese Communist Party, Nimeri confiscated the property of the powerful Moslem sects.

But relations with the Communists quickly began to deteriorate and ended when a group of pro-Communist officers tried to overthrow Nimeri in 1971. The attempt failed, and its leaders were executed.

Nimeri continued to move to the right. Relations with the Soviet Union cooled, and the nation formed an alliance with Egypt and the United States.

While his backing for Egypt's peace treaty with Israel and his allowing first the Israelis, then the CIA, to fly Ethiopian Jews to Israel may have won him plaudits in the West, many Sudanese only saw subservience to a foreign power.

In the 1980s, as the country's economic problems became more extreme, Nimeri made alliance with the fundamentalist Moslem Brotherhood and imposed strict Islamic law both on the Moslem north and Christian and animist south. Last year, he moved against the fundamentalists but apparently did not regain the support he had lost in the south and among less orthodox Moslems.

Almost to the end there were just enough Sudanese to hesitate at the thought of what would happen without him at the helm to keep him in power.

Such tolerance was a commentary on Sudan's ever-growing problems. For if the current drought and influx of refugees from Ethiopia could not be blamed on Nimeri, the same could not be said of the economic and financial crisis.

To the limited degree that Nimeri was aware of the country's disastrous finances -- and one despairing diplomat called him "the Sudan's chief noneconomist" -- he kept hoping that he would be saved by some miracle.

The discovery of oil in the south at one point seemed to have been just that miracle.

In 1972, Nimeri had worked out an agreement with secessionist leaders in the southern part of the country, ending a 17-year civil war and granting the region a degree of autonomy.

But with his handling of the oil and other issues he so enraged the southerners that one of the leaders, John Garang, formed the Sudanese Peoples Liberation Movement in 1983 and began a rebellion to oust him.

Nimeri first refused to locate a major refinery in the south and then compunded the issue by imposing sharia, or koranic, law through both the Moslem north and the Christian and animist south. The rebellion in the south grew apace.

There and then, many Sudanese wrote him off because if Nimeri had a claim to fame it was in ending the 17-year-long civil war pitting the south against the north.

To the end, Nimeri remained a tough, macho figure, never afraid of exposing himself physically.

Flying to the United States on a visit just as the first of the demonstrations was beginning last week was entirely in keeping with his character. He had left the country during previous crises, intentionally daring his divided enemies to overthrow him.