LONDON -- British authorities apologized Thursday after an investigation found that at least 161,000 mostly African and Indian military service personnel who died during the First World War weren't properly honoured due to "pervasive racism." It said that number could possibly range up to 350,000.

The investigation found that those service members were either not commemorated by name or weren't commemorated at all, according to a report commissioned by the Commonwealth War Graves Commission. Between 45,000 and 54,000 other casualties were "commemorated unequally."

The treatment of these soldiers, who served in Africa, Asia and the Middle East, contrasts with that of the men and women who died in Europe. It also violates the principle that all war dead should be remembered in the same way because they all made the same enormous sacrifice.

"On behalf of the Commonwealth War Graves Commission and the government, both of the time and today, I want to apologize for the failures to live up to their founding principles all those years ago and express deep regret that it has taken so long to rectify the situation," Defence Secretary Ben Wallace said in the House of Commons. "Whilst we can't change the past, we can make amends and take action."

The commission was created in 1917 to ensure that all who died in the service of the British Empire during World War I were identified and properly honoured. Its responsibilities were later expanded to include those who died during World War II, and it now oversees the graves of 1.7 million men and women who died during the two wars.

The commission appointed an independent panel to investigate claims of unequal treatment following a 2019 TV documentary presented by David Lammy, a lawmaker from the opposition Labour Party, that focused on the way African casualties were commemorated. One researcher who worked on the documentary said she had forwarded information about her concerns to the commission more than a decade earlier but no action was taken.

The investigation found that tens of thousands of service personnel who died in Africa, Asia and the Middle East either weren't commemorated at all or were only honoured anonymously on collective memorials. Others had their names recorded on paper registers rather than stone monuments. The battlefield graves of thousands more were abandoned without the remains ever being identified.

In Europe, the commission attempted to identify all of the dead and bury their remains under identical white headstones that still dot cemeteries from France to Turkey. The names of those who couldn't be identified were recorded on mass memorials.

"No apology can ever make up for the indignity suffered by the unremembered,? Lammy said. "However, this apology does offer the opportunity for us as a nation to work through this ugly part of our history -- and properly pay our respects to every soldier who has sacrificed their life for us."

David Olusoga, a professor of public history at the University of Manchester, said World War I changed British culture, in part because of the powerful way that the dead were remembered.

"(Yet) when it came to men who were black and brown and Asian and African, it is not equal. Particularly the Africans, who have been treated in a way that is ΓÇª apartheid in death,? he told the BBC. "It is an absolute scandal."

The inequality was rooted in the "imperial ideology" of British and colonial authorities in the years immediately after World War I, the investigation found. For instance, the officer in charge of graves registration in East Africa asserted that central memorials were the most appropriate way to commemorate the dead because most Africans "do not attach any sentiment" to the graves of their dead.

"Sweeping judgements such as these, which chose to ignore the intricacies of faith, culture and customs in Africa outside Christian and Islamic traditions, played a significant role in shaping the (commission's) policies that led to unequal treatment," the panel said.

These attitudes were adopted at the highest levels of the British government. Winston Churchill, then-Secretary of State for the Colonies, in 1921 signed a document directing that collective memorials, rather than individual headstones, should be erected for African troops in Africa.

In response to the panel's findings, the commission said it would continue to search for the names of African, Asian and Middle Eastern casualties and add their names to its records. It also promised to be more flexible in the evidence required to support requests for commemoration in light of the panel's concerns about the availability of paper records.

The commission also said it would improve transparency about this issue on its website and set up an expert panel to advise it.

"We apologize unreservedly for the historical wrongs found in this report and for failing to live up to founding principle, of `equality of treatment in death,"' the commission said.