As a black Moor, Mohammed Dahi has never been bound by the obligatory slavery that surrounded him in childhood, but carries the caste brand of haratin, or freed slave, that forms the bottom rung in Mauritania's rigidly stratified society.

Sidi Cherif is a ligt-skinned Moor whose father was a poor nomadic herder of sheep, goats and camels, a secondary caste status beneath the top-level caste of warriors and marabouts, or Moslem Holymen, in the four-tiered structure. Artisans and craftsmen from the third-level.

Here in the capital of Nouakchott, Dahi is pursuing a career as a teacher, and Cherif is a government bureaucrat. The attitudes of the two men toward each other's groups and, significantly, toward a third, the non-Moorish black farming migrants from the southern Senegal river valley who were never enslaved, are all joined in a complicated social mosaic of mounting tension that has kept Mauritania delicately balanced on the knife's edge of social upheavel since independence from France in 1960.

Mauritania straddles Africa's fragile "shatter zone," a belt of land that stretches from here to the Sudan through Mali, Niger and war-ravaged Chad, where northern Arab Africa and black sub-Saharan Africa uncomfortably meet. Sudan and Chad have endured long civil wars that grew out of this ethnic clash. Mali's government brutally crushed the northern Touareg nomads during an uprising in the early 1960s.

Mauritania is unique among the countries of the zone, however, in that the nomadic Moorish nobles have always controlled the country. The entire population of 1.4 million is uniformly Moslem, also an exception in the "shatter zone."

Still, in 1966, the southern blacks and Moors, aided by the haratins, fought bloody battles in the streets of Nouakchott. The non-Moorish blacks had rejected the government's attempt to impose Arabic as a national language of instruction. The southerners saw the introduction of Arabic as an attempt to exclude them from government, while the Moorish nobility and their haratin allies saw it as a natural development for their orientation toward Arab North Africa and Mecca.

The potential for another violent eruption is starkly evident in overcrowded Nouakchott today, where the groups are uneasily meshed into a tent and shanty slum that rings the city.

Slavery, a deeply ingrained practice here, was outlawed for the third time in Mauritania's 20th-century history just last year by the military government of Lt. Col. Mohammed Khouna Haidalla. Mauritania, Haidalla said in an interview, is "a society where there still persist manifestations of certain traditions judged incompatible with the demands of our period."

The delicate scale of these ancient practices and relationships was evident in the refusal of both Dahi and Cherif, who were approached for interviews through an intermediary, to have their real names used or to be photographed. Dahi spoke for most of the hour-long interview with a hesitancy and emotional timbre in his voice that revealed the depth of emotion evoked by the subject of his inferior haratin status. Higher-caste Cherif was, by comparison, self-confident and outspokenly steadfast in his opinions.

Born 22 years ago of a tenant farming harratin father, Dahi grew up in the rural southern Mauritanian town of Rosso and joined the migration to Nouakcott in 1978 after winning a government scholarship to attend a teacher-training college here. Now, toward the end of the third year of his four-year course, Dahi said he was anxious about possible future discrimination against him in employment by the politically dominant lighter skinned Moors. A descendant of the country's riverside-dwelling blacks, Dahi considers himself a Moor by culture, however, and speaks the Moorish hassaniya Arabic as his mother tongue, as do virtually all haratin.

"We are all Moors," said Dahi. "It is only our skin color that makes any difference."

Dahi admitted to ambiguous feelings in identifying with the large numbers of non-Moorish blacks who have flocked into Nouakchott and dominate the country's civil service.The blacks, who are also Moslems, have absorbed French culture and look toward the region's black-ruled states, like Senegal, for ethnic identification. With their drive for Western-style education, they form the largest proportion of educated elites.

But Dahi said it is not axiomatic that the haratin will line up again with the Moors in any future confrontation. "It depends on the situation," said Dahi, who indicated that that urbanization is weakening the haratins' allegiance to the Moors. "We younger [haratin] would try and remain neutral while the older haratin would probably join the Moors," he added. "My generation accepts that the blacks form our origins while the older haratin do not."

Haratins are estimated to represent 25 percent of the population and the southern blacks about 25 percent as well. The lighter skin upper-caste Moors, mixed descendants of Arabs, Berbers and blacks, are about 50 percent of the total. Any large shift of allegiance by the haratins to the non-Moorish blacks would endanger the upper-caste Moors' political dominance.

A survey of 1980 attitudes in Mauritania revealed the depth of division in attitudes and some of the stereotypes each group holds about the others. The upper-caste Moors disdain manual labor, feel that blacks are predestined to work under their control and place a heavy value on commerce and leisure.

The haratin, by contrast, grow up socialized to work hard and, as a result, are generally fitter physically than upper-caste Moors. More haratin were able to survive the drought than Moors, for example. The blacks feel that Western education is the avenue to advancement, fear that Arab countries will not accept them for university study if they are forced to study in Arabic, consider themselves superior to all Moorish groups, and consider upper-caste Moors to be lazy, ignorant and inefficient. They also resent the Moors' historic role as slavers.

Upper-caste Moor Cherif, 30, was born in the southern village of Mederdra, where he grew up around slaves and haratin. The treatment of the slaves "depended on who owned them," he recalled. A civil service employe, Cherif has seen Nouakchott grow from a city of 30,000 people when he arrived for high school in 1964 to its presently population of 200,000. Blacks came to the city in large numbers from the south, exacerbating existing tensions by mingling in the Moorish-dominated north with the nomads in large numbers.

"Between Moors and blacks, the fears are economic, that one group will displace or take advantage of the other," said Cherif. "The tension really increases when the government makes a rapprochement with Libya, and the blacks become unhappy and fearful that they will be dragged into Arab matters . . . But when the presidents of Senegal and Mali come here, they are happy.

"I don't belive there is discrimination against the blacks. They are less than 30 percent of the country and several ministries are more than 50 percent black, such as the ministries of education and health. There may be discrimination at the Cabinent level, but this is another matter. It really is a matter of individuals having bad luck rather than any discrimination," he claimed.

The haratins and Moors were very close until 1976, Cherif continued, "when the intellectual haratin started a movement, not a movement against the Moors or a reaching out to join the blacks, but a movement of self-identity." The younger haratin "are attracted to it, but there will be no linking up with blacks," he argued. "The ties between haratin and Moors are too strong."