Maj. Gen. Mohammed Siad Barre, who was overthrown as President of Somalia in 1991 after ruling that impoverished African country for more than 20 years, died yesterday in exile in Lagos, Nigeria.

Official accounts put his age near 74, but reference books place his birth variously between 1912 and 1920.

General Siad Barre's departure from the scene four years ago left Somalia without a central authority, on the brink of mass starvation and with a civil war among feuding clans and their militias.

As commander of the armed forces, he had taken control of Somalia, in the Horn of Africa, in 1969. The country of about nine million -- mostly nomads -- with a per capita income of about $175 a year is one of the most impoverished.

General Siad Barre's rule was marked by a war with Ethiopia, a flip-flop in political alliances from the Soviet Union to the United States, and growing allegations of human rights abuses.

In its final years, his Government steadily lost control of much of the countryside to the chiefs of warring clans, plunging the country into racking social and economic problems. Human rights groups issued reports citing a consistent pattern of political imprisonment, torture, political killings and discrimination against the Isaaks clan.

In May 1986, President Siad Barre was seriously injured in an automobile accident, but later that year he was nominated by the country's sole legal political party for re-election, ran uncontested and won a new seven-year term.

Yet there continued to be questions about the extent of his recovery. Reports of feeble health combined with the country's internal strife led to a weakening of his grasp on power, American officials believed. Toward the end, they said, he was struggling to arrange a succession that would insure that his family and clan -- the Marehan clan -- remained in power.

Many believed he was grooming his son, Maslah, who was a Soviet-trained army general.

Instead, Somalia was steeped in turmoil. United Nations and United States troops partly managed to open relief-supply lines to a famished population, but that costly effort, too, has yet to bring about a political solution and peace to the country.

According to his Government's version, General Siad Barre was born in 1919 or 1921. He was educated in private schools in Mogadishu, the capital, and attended the Military Academy in Italy and School of Administration and Politics in Somalia.

From 1941 to 1960 he served in the Somali Police Force and rose to the rank of chief inspector. In 1960, when the Somali Republic was created out of territories formerly ruled by the Italians and British, he was made a colonel and deputy commandant of the newly formed Somali National Army. He rose to brigadier general in 1962 and major general in 1966.

On Oct. 21, 1969, shortly after the President, Dr. Abdirashid Ali Shermarke, was assassinated by a police officer in a factional quarrel, General Siad Barre led a successful and bloodless coup. Assuming power, he espoused "scientific socialism," arguing there was no inconsistency with the principles of Islam, and turned to the Soviet Union for support.

In 1977, his army invaded the disputed Ogaden area of southeastern Ethiopia. At about the same time, Ethiopia split with the United States and became more closely aligned with the Soviet Union. With the help of Cuban troops and billions of dollars' worth of Soviet weapons, the Ethiopians turned back the Somalis in 1978.

General Siad Barre denounced the Russians and turned to the United States. Somalia received military and economic aid from the United States for a promise of American use of the port of Berbera on the Gulf of Aden. But aid declined drastically as allegations of human rights abuses rose. In 1989, Somalia revived contacts with Libya.

In May 1988, fierce fighting broke out in the north between the Government and rebels who contended they had been discriminated against by the Siad Barre Government and were fighting for a more democratic Government.

A report commissioned by the State Department and made public in September 1989 said the Somali Army "purposely murdered" at least 5,000 unarmed civilians over a 10-month period in the early phases. The Government denied the allegation.

More than 10,000 people were reported killed in the months that followed, with allegations that the Somali military had bombed towns and strafed fleeing residents.

Amnesty International said in August 1988 that since 1981 the Government had used torture and "widespread arbitrary arrests, ill treatment and summary executions" of civilians suspected of collaborating with the rebels.

In his last year in office, President Siad Barre promised reforms to introduce multi-party democracy.

In June 1990, a hundred prominent citizens signed a declaration called the Mogadishu Manifesto, calling for his resignation and the appointment of a transitional government pending free elections.

He called the manifesto "destructive," and jailed 45 of those who had signed it, but about a month later he ordered their release. He agreed to multi-party parliamentary elections to be scheduled in February but later canceled them and the civil war took its course.

Photo: Mohammed Siad Barre (Camera Press, 1991)