JOHANNESBURG (AP) — Three white men in South Africa have been charged with crimes including attempted murder after an alleged racist attack on two Black boys that has sparked public outrage.

The men were caught on video assaulting the Black teenagers who were using a swimming pool at the Maselspoort resort in the Free State province.

The men were trying to prevent the teenagers from swimming, claiming that the pool was reserved for white people.

In the video, widely viewed on social media in South Africa, the men shouted at the boys and hit them. One of the men pushed one of the boys underwater.

Further security video footage shows the men attempting to prevent the teenagers from entering the pool and the group of white people that were swimming at the time exiting the pool as soon as the Black teenagers entered it.

According to police, Johan Nel, 33, and Jan Stephanus van der Westhuizen, 47, were released on a warning and are expected to appear again in court next year.

“The two appeared in court on charges of assault common and crimen injuria and the matter was postponed to 25 January 2023 while being released on warning,” said Police Commissioner Baile Motswenyane.

The third suspect was expected to appear in court on Thursday, where various political parties and activities were protesting outside the courthouse.

The incident has been widely condemned, including by President Cyril Ramaphosa.

“As Black and white South Africans, we should be united in condemning all manifestations of racism and attempts to explain or defend such crimes. Racism is not a problem to be fought by Black South Africans only,” Ramaphosa said in a statement.

Members of the leftist Economic Freedom Fighters party visited the resort and demanded answers from the manager, who claimed the resort did not have a racial segregation policy.

Racism remains a thorny issue in South Africa nearly 30 years after South Africa’s transition from white-minority rule, known as apartheid, to democracy.

In 2018, real estate agent Vicky Momberg was sentenced to three years in prison for shouting racial insults at a Black policeman in a landmark judgment that was the first to imprison a person for a racist act.

In 2020, Adam Catzavelos, a white man, was convicted of crimen injuria and given a suspended sentence after using racist slurs in a video that circulated on social media.