NAIROBI, KENYA, OCT. 31 -- Julius Nyerere, Tanzania's founder and president, said two years ago that he had had enough. In a rare act for an African leader, he voluntarily gave up the presidency.

The "father of African socialism" said at the time that he would serve only 24 more months as chairman of his country's ruling party. Then, he said, he would return to his "nice little house" in the village of his birth near Lake Victoria.

This week, however, it became official that Nyerere would not be going home to the lake. At a party conference in the central Tanzanian town of Dodoma, the 65-year-old former schoolteacher was chosen for five more years as party chairman.

From that position, as head of the country's supreme policy-making organ, Nyerere will retain his power to influence, and perhaps undermine, the capitalist changes made by his successor, President Ali Hassan Mwinyi.

The reluctance of Nyerere and Tanzania's ruling party to turn away from socialism is indicative of the half-hearted recent conversion of many poor African countries to free-market economic reform.

The International Monetary Fund supervises reform programs in 30 of the 45 countries of sub-Saharan Africa. These programs are supposed to shrink government spending while creating incentives for farmers to grow more food and cash crops.

But in Tanzania, as in Zambia, Sudan and several other countries, there remains a deep ideological commitment to socialism.

When Nyerere stepped down, he acknowledged that his socialist policies had helped impoverish Tanzania by nationalizing too many industries and centralizing too much power in the government. This past year, however, he appears to have had second thoughts. He defended his Chinese-inspired schemes for collectivized farming and blasted the IMF as "bent on suppressing the weak developing countries."

Nyerere's reputation, unlike that of many African leaders, is that of an honest and idealistic man. The same cannot be said for many of those who served in his government. For these officials, who have grown rich in a highly centralized system of government, socialist dogma is inextricably linked with vested interest.

After Nyerere retired as president, Mwinyi led Tanzania in an economic about-face. He quickly signed a new agreement with the IMF, a move that Nyerere had long resisted. In less than two years, free-market reform helped boost farm production, increased the availability of consumer goods and opened the door for generous rescheduling of the country's large foreign debt.

But the pace of change also created unease among the socialist old guard in the government and the party. Western diplomats said the continuation of Nyerere as party chairman means that Mwinyi probably will remain unable to replace many of the senior officials in his government. Most of them were appointed by, and remain loyal to, Nyerere.

At the party conference that ended today both Nyerere and Mwinyi went out of their way to play down their philosophical differences.

Nyerere said that he was staying on as chairman simply because Mwinyi was too busy as head of state to do both jobs. Mwinyi said that Nyerere was a selfless leader who devoted his life to serving mankind.

There was no public mention of Mwinyi's earlier threat to quit the presidency if Nyerere stayed on. Nor did Nyerere mention that he had said, as recently as July, that it would be best for Tanzania if the country's president and the party chairman were the same man.