They are South Africa's first people, but since the first Europeans set foot on their soil, they have always been last in line. From the moment they encountered the Dutch Afrikaaners in 1652, the nomadic Khoekhoen realised these visitors were not like anyone they had encountered before. The Western colonialists were going to be a permanent fixture of the landscape - and they would change the lives of its indigenous people forever.
Almost everything the tribe had established over the previous 30,000 years was gradually taken away from them. The land they had roamed for centuries was taken over by white settlers. The pastoral peace which they cultivated for generations was shattered. Much of the tribe died out; those who remained were forced into poorly paid manual work. Not even their name would remain; rather they were dubbed "Hottentots" by the Dutch - a pejorative term loaded with the derision with which they were viewed.
As a people, the Khoekhoen were ridiculed as a collection of backward curiosities. Many were even brought to Europe during the 19th century to be paraded naked for the entertainment of the London and Paris elites.
They have suffered 350 years of shame and degradation, but, at last, the descendants of the first people to meet southern Africa's white settlers may be able to return to the land that was once theirs. Later this month, the South African government is set to announce a multi-billion rand compensation deal and the return of land the South African courts have deemed was stolen under racist mineral-rights laws in the 1920s.
About 4,000 members of the Richtersveld community in the north-west corner of South Africa sued for 2.5bn rand in damages last year after the Constitutional Court ruled in 2003 that state diamond group Alexkor was mining on their land.
The victory ends an eight-year legal battle. But it still leaves much of the land that once belonged to the pastoralist Khoekhoen out of reach. For tens of thousands of years, the Khoekhoen, also known as the Khoi Khoi, lived a nomadic existence in the Cape region of what is now South Africa.
Meaning "men of men" or "people people", the Khoekhoen were part of a larger group spread across southern Africa, called the Khoisan. While the Khoekheon were herders, the San branch were hunter gatherers. Roaming the Cape with their herds of cattle, the Khoekhoen lifestyle rarely came under threat. Whenever they came across other tribes, the only conflict arose from stealing the other group's cattle and protecting their own.
They lived relatively peacefully until the mid-17th century and the arrival of the first white Dutch colonialists in 1652, who set to work building a more permanent base on the Cape, establishing the Dutch East India Company.
The Khoekhoen needed a large amount of land on which to graze their cattle, but the Dutch refused to recognise their rights. Jan van Riebeck, the explorer who led the first Dutch settlement, is quoted in Kevin Shillington's History of Africa, describing how the Khoekhoen objected to the colonialists' desire for land. According to van Riebeck, they said: "You get many cattle, you come and occupy our pasture with them, and then say the land is not wide enough for us both. Who then, with the greatest degree of justice, should give way? The natural owners or the foreign invaders?" But the natural owners were forced to give way. In 1659, both sides fought over grazing land and the Khoekhoen lost.
As the Dutch expanded throughout southern Africa, many of the Khoekhoen ended up as slaves, working on farms or in the Cape Colony. Gradually, they lost more and more of their grazing lands.
Droughts combined with cattle disease caused further problems, and when a smallpox epidemic broke out in 1713, decimating their numbers, their way of life came to an end.
The word "Hottentot" is derived from the Dutch word for stutterer. It swiftly became simply a disparaging term for anyone who was black and living in the Cape. According to Professor Nicholas Hudson, a historian at the University of British Columbia in Canada, the Khoekhoen became the "most vilified people on Earth".
"They were seen as the least civilised and brutish example of the human species, indeed barely human," said Professor Hudson. "I think that's because they stirred fears in Westerners. From the first encounter, the 'Hottentot' embodied a kind of society so different from Western patterns that they threatened the West's conception of its own status as the very embodiment of a universal 'humanness'."
To the eyes of the white settlers, the Khoekhoen were like no human beings they had ever encountered, a mystique that was compounded by the vast array of gods and monsters that formed part of their beliefs. Their most powerful deity, Gaunab, the god of the sky, is thought to kill people by shooting arrows from his seat in the stars. Monsters include the Aigamuxa, a man-eating creature with blazing eyes on the instep of its feet.
But it was the appearance of the Khoekhoen themselves which most intrigued colonialists. The women, in particular, were deemed to have an almost animalistic sexual appeal. Colonial records show that at least two Khoekhoen women, including most famously Saartjie Baartman, were taken to Europe in the early 19th century and displayed as part of a bizarre and demeaning exhibition called "The Hottentot Venus".
Ms Baartman was told she was travelling to Europe to find fame and fortune, but it soon became clear that she was taking part in nothing more than a human freak show for the entertainment of Europe's chattering classes.
After her death in 1815, Baartman's body was put on display in a Paris museum and only removed in 1976. It was not until the end of apartheid that steps were taken to return her remains to South Africa. Eventually, the French assembly acquiesced and Baartman was finally buried in the Gatmoos Valley, where she was born, in 2002.
Even for those Khoekhoen who remained in southern Africa, life did not improve during the 18th and 19th centuries. Attempts to resist colonialisation failed and the cultural identity maintained solidly by the tribe for centuries began to disappear.
But the dawn of the 20th century brought an even more destructive force to the lives of the Khoekhoen in the form of the glittering deposits lying hitherto undiscovered along the west coast of southern Africa.
The first diamonds were mined in 1908, setting off a rush to find more. In 1926 deposits were discovered at Alexander Bay in the Richtersveld region, which runs along the Orange river that now forms the border between South Africa and Namibia. Under mineral-rights legislation drawn up by the then government, the land at Alexander Bay - though lived on by the Richtersveld Khoekhoen - was deemed to belong to the state. The Khoekhoen were moved off and a diamond mine was opened.
Professor Andrew Smith, an archaeologist at University of Cape Town, explained: "The Khoekhoen were seen as not being able to administer their own land because they were nomads, and did not have any government. They thus became wards of the state. It is an old story of colonial expansion at the expense of aboriginal people."
After the fall of the apartheid government in 1994, the ANC introduced a Land Claims Court to help restore ownership to millions of people forcibly removed from their homes under racist laws. The 4,000-strong former residents of the Richtersveld - who currently live in four villages set aside for them - went to court in 1998 in an attempt to get their land back.
Members of the community demanded the return of 85,000 hectares of land and said they wanted 1.5bn rand in compensation for the diamonds extracted from the rich coastal minefields. They also wanted one billion rand for damage done to the environment and 10 million rand for their "pain and suffering".
In 2003, South Africa's highest court said the Richtersveld community had been removed under racist laws and was entitled to have land and mineral rights returned. And now, finally, after years of negotiations and decades of struggle, a deal has been struck between the government and the rest of the Khoekhoen community. It is expected to award the indigenous population compensation in the region of two to three billion rand. The final settlement will be announced later this month.
The Khoekhoen tribe's fight for land is not unusual. There are parallels in other countries, most pertinently in Botswana. There, just across the border with South Africa and Namibia, the Kalahari bushmen have been driven off the Central Kalahari Game Reserve - an area specially created for them in the first place. The Botswanan government is currently attempting to change the constitution to bar the bushmen permanently, and the country's constitutional court is currently deliberating.
Jonathan Mazower, research coordinator at Survival International, a charity campaigning on behalf of the bushmen, said the Khoekhoen case could set a significant precedent.
"The case has huge implications for other indigenous people of southern Africa like the bushmen in Botswana because it shows that they do actually have rights to their land, even if the government says they do not," he said. "Governments can no longer just do what they want with vulnerable minorities. There are evolving standards under international law which are increasingly important."
Professor Hudson added: "There is great historical significance in the reassertion of Khoi identity and the settlement concerning their land. A people that once almost symbolised Western contempt for non-Western people is now insisting on their human rights. This juncture in turn symbolises a new era, one would hope, in attitudes toward the human species in all its varieties."
When the compensation bill is finally handed over to the descendants of the Richtersveld Khoekhoen, the tricky question will arise of how to spend the money awarded. It is likely to be used communally rather than shared out between individuals. A representative committee is expected to be formed and it has already been suggested that better schools, health clinics, new housing and improved roads for the Khoekhoen will be top of the agenda. "The Richtersveld community seems quite together on this," said Professor Smith, "unlike other groups who have been offered land restitution and who are fractured socially."
But while the money may be spent wisely, the battle for recognition continues. The Khoekhoen were the first inhabitants of what is now South Africa but they have never been officially recognised as such by the government. Nor has their language been designated an official South African language. Tribal leaders are hopeful that they will eventually be recognised, in the same way that aborigines in Australia are identified as that nation's first inhabitants.
In the meantime, work will get underway on rehabilitating a coastal area battered by 80 years of diamond mining. There is an outside chance that the damage has not been irreversible and that, once the land has had an opportunity to recover, it could be used once more for grazing.
More than 350 years after they became the first African tribes to meet white settlers, the Khoekhoen may finally be able to leave their villages behind them, take their cattle, and continue the way of life they began all those years ago.