France yielded its last colony in Africa last night, lowering the Tricolor over the Territory of the Afars and Issas and launching its tiny land on the Horn of Africa into an uncertain future as the independent Republic of Djibouti.

Just after midnight, President Hassan Gouled Aptidon received the keys of the ornate, white High Commission building on the waterfront, ending 115 years of French rule.

After a 21-gun salute, the flag of Djibouti, bars of light green and blue with a red star on a white triangle, was hoisted outside what is now the presidential palace. The flag started appearing days ago on the streets of this sleepy, shabby little capital.

Few other countries in Africa have come to independence with gloomier prospects for political stability or economic progress. Djibouti has no known natural resources aside from salt and a little gypsum. It has no university, only a handful of residents with any higher education. There is widespread illiteracy and unemployment, and a history of tribal rivalry between the majority Issas and the minority Afars. The tribal groups in turn are split politically.

One resident diplomat said he gave the new government only six months before those problems developed into discontent and unrest that challenged the regime.

Yet there are signs that Djibouti may be saved, because it suits the convenience of powerful neighbors to have an independent stable country here and they are expected to pump in economic aid to keep it afloat. The transfer of power was achieved peacefully and the French hope that they have put together enough international support and internal consensus to preserve the fragile little nation.

Djibouti is situated at the Bad el Mander, a 12-mile strait connecting the Red Sea and the Suez Canal with the Gulf of Aden and Indian Ocean. Djibouti has a harbor that serves several nations of East Africa, the Red Sea coast and the Arabian peninsula, such as Israel, Saudi Arabia and Egypt as well as Ethiopia and Somali. For all of them, Djibouti has an im- portance far beyond its mineral resources and population of less than 250,000. There are even those who envision a prosperous future for Djibouti as a kind of African Sinapore, making itself indispensable to neighbors at odds with each other.

Djibouti is to become the 49th member state of the Organization of African Unity and the 21st member of the Arab League. Gouled has committed himself to placing this country, most whose people are of Somali stock, firmly in the Arab camp Neither the Arab countries nor any others, however, were represented last night by a head of state or head of government.

Djibouti was tranquil throughout the weekend preceding independence but there was a threat of violence at the last minute when the population of the capital was excluded from the ceremony. A crowd of several hundred people tried to break through the barricades, briefly trapping U.S. Consul Walter Clarke in his car, but French gendarmes held the crowd back.

The continuing presence in the harbor of a French fleet, including the aircraft carrier Foch, was nother reminder that French influence will continue to prevail here for some time.

Independence was formally proclaimed last night when Ahmed Dini Ahmed, president of the National Assembly, read the new constitution and said the Republic of Djibouti "one and indivisible, is proclaimed."

Gouled, in an address to the assembly, called on all citizens of the republic to "work, build and share." There is little to share and the task of building Djibouti into a modern nation is enormous.

Africa's newest country is a barren volcanic enclave about the size of New Hampshire that was colonized for its location, which is at once its only resource and its greatest danger.

Ethiopia and Somalia, either of which could crush Djibouti overnight, have territorial ambitions here, but a move by one would probably mean war with the other. France is expected to keep 2,000 to 3,000 troops here to protect Djibouti from invasion until it forms its own army, but the French have made clear they will assume no resposibility for internal upheaval brought on by tribal rivalries or instagated by one of the neighboring states.

Few other countries in Africa have come to independence with gloomier prospects for political stability or economic progress. Djibouti has no known natural resources aside from salt and little gypsum. It has no university, only a handful of residents with any higher education. There is widespread illiteracy and unemployment, and a history of tribal rivalry between the majority Issas and the minority Afars. The tribal groups in turn are split politically.

one resident diplomat said he gave the new government only six months before those problems developed into discontent and unrest that challenged the regime.

Yet there are signs that Djibouti may be saved, because it suits the convenience of powerful neighbors to have an independent stable country here and they are expected to pump in economic aid to keep it afloat. The transfer of power was achieved peacefully and the French hope that they have put together enough international support and internal consensus to preserve the fragile little nation.

Djibouti is situated at the Bab el Mandeb, a 12-mile-wide strait connecting the Red Sea and the Suez Canal with the Gulf of Aden and Indian Ocean. Djibouti has a harbor that serves several nations of East Africa, the Red Sea coast and the Arabian peninsula - including regional powers with conflicting interests, such as Israel, Saudi Arabia and Egypt, as well as Ethiopia and Somalia. For all of them, Djibouti has an importance far beyond its minimal resources and population of less than 250,000. There are even those who envision a prosperous future for Djibouti as a kind of African-Singapore, making itself indispensable to neighbors at odds with each other.

President Gouled, 61-year-old career politician, has said that his country requires urgent infusions of aid from the world community.He has already approached Saudi Arabia and Egypt, both of which are expected to respond favorably to his Arab nationalism and his anti-communism.

The United States is also understood to be receptive to aid requests but there is some bewilderment here over the total silence from the Soviet Union and its European allies. The United States has a consulate here but Moscow has not been heard from.

China has decided to recognize the Republic of Djibouti the New China News Agency reported. Chinese party chairman Hua Kuo-feng sent a message to President Gouled voicing a wish for continuous development of friendly relations between China and Djibouti.

In the hope of averting political instability that could split the country and gave Somalia a pretext to invade a territory it has historically claimed, France and the Organization of African Unity arranged for the election of a single-chamber legislature of 33 Issas, 30 Afars and two Arabs, a mixture that appears to approximate the racial composition of the population Afars in the Issa-dominated and proracial composition of the population.

Its president is Dini, one of the few Somali African Popular League for Independence, which is headed by President Gouled. Because Gouled in aging and reportedly in poor health, Dini is already being talked about by some analysts as Djibouti's man of the future.

Dini said in an interview that tribal factionlism need not bring down Djibouti if there is economic progress.

"In a country where people have very little," he said, "it is natural that those who have something share with those close to them. So Mr. So and So is a tribalist if he gives a job to his nephew. But where our people have work there is no problem. They work together without bitterness and their children play together. Our troubles are economic troubles."

Dini said, only partly in jest, that "ours is a country rich only in pebbles.What we want is for the industrial countries of the West to find a use for them."

Gouled has said Djibouti will follow the Arab line on foreign policy but will seek "neutrality and equilibrium" between Somalia and non-Arab Ethiopia. According to Dini, that does not mean Djibouti will adopt the Socialist economic policies of its two feuding neighbors.

"We are not attracted to socialism," he said. "That's not because I have some money and a reputation as a bourgeois, but because we have seen what has happened in other African countries. Some of them have gone backward since independence."

With the lowering of the French Tricolor over Djibouti, the era of European colonialism in Africa has all but ended. Rhodesia is still technically a colony of Britain, but aside from that there remain only two Spanish enclaves on the coast of Morocco.