CAPE TOWN - A South African court has halted construction of Amazon's new Africa headquarters after some descendants of the country's earliest inhabitants said the land it would be built on was sacred.

The Western Cape division of the High Court interdicted the project developer from continuing with works at the Cape Town site until there had been meaningful engagement and consultation with affected indigenous peoples.

"This matter ultimately concerns the rights of indigenous peoples .... The fundamental right to culture and heritage of indigenous groups, more particularly the Khoi and San First Nations Peoples, are under threat in the absence of proper consultation," Judge Patricia Goliath said in her ruling.

The Khoi and the San were the earliest inhabitants of South Africa, the latter roaming as hunter gatherers for tens of thousands of years, and the former joining them as pastoralists more than 2,000 years ago.

Some of their descendants had objected to the River Club development, where Amazon would be the "anchor tenant" but which also includes plans for a hotel, retail offices and homes, as it lies at the confluence of two rivers considered sacred, the Black and Liesbeek Rivers.

Not everyone identifying with the Khoi and San was against the project. An association of Khoi and San who supported it was among the respondents in the case.

Amazon was not named as a respondent, and the company did not respond to an emailed request for comment sent outside office hours. When the court case was launched early this year a spokesperson declined comment.

Goliath said her ruling should not be construed as a criticism of the development but that the core issue was that there needed to be proper consultation before it could go ahead.

Amazon already employs thousands of people in data hubs in Cape Town, and with over a third of South Africans unemployed authorities are keen to encourage foreign investment.

Construction of the River Club development had continued despite the case being before the court.

(Reporting by Wendell Roelf and Alexander Winning Editing by Mark Potter)