Shiraaz Mohamed, Associated Press
Sudanese president Omar al-Bashir is seen during a photo op at the African Union summit in Johannesburg, Sunday June 14 2015. A South African judge on Sunday ordered authorities to prevent al-Bashir from leaving the country because of an international order for his arrest, human rights activists said.

JOHANNESBURG — A South African judge on Sunday ordered authorities to prevent Sudanese President Omar al-Bashir, who is in South Africa for an African Union summit, from leaving the country because of an international order for his arrest, human rights activists said.

Al-Bashir appeared for a group photo with other African leaders at the summit in Johannesburg on Sunday, wearing a blue three-piece suit, a tie and a smile as cameras flashed.

Earlier Sunday, a South African judge ordered authorities to prevent al-Bashir from leaving South Africa because he is wanted by the International Criminal Court, human rights activists said Sunday.

The African National Congress, which is South Africa's ruling party, said the South African government granted immunity "for all (summit) participants as part of the international norms for countries hosting such gathering of the AU or even the United Nations."

"It is on this basis, amongst others, that the ANC calls upon government to challenge the order now being brought to compel the South African government to detain President al-Bashir," the ANC said, adding that African and Eastern European countries "continue to unjustifiably bear the brunt of the decisions of the ICC."

Even before Sunday's events, the African Union had asked the International Criminal Court to stop proceedings against sitting presidents and said it will not compel any member states to arrest a leader on behalf of the court.

Al-Bashir has traveled abroad before and local authorities had not detained him at the behest of the ICC, which is based in The Hague, Netherlands.

The Southern Africa Litigation Centre, a rights group, said it secured a judge's ruling that the government must stop al-Bashir from leaving South Africa while the court hears arguments for his arrest for alleged genocide and other crimes.

International Criminal Court prosecutor Fatou Bensouda has said South Africa is under a legal obligation to arrest al-Bashir and surrender him to the court. Her office has been in touch with South African authorities on the Sudanese president's reported visit.

If al-Bashir is not arrested, the matter will be reported to the court's assembly of states and the United Nations Security Council, which first referred the case of Sudan's Darfur region to the International Criminal Court in 2005, she said.

The charges against al-Bashir, who took power in a 1989 coup, stem from reported atrocities in the conflict in Darfur, in which 300,000 people were killed and 2 million displaced in the government's campaign, according to United Nations figures.

He has visited Malawi, Kenya, Chad and Congo in the last few years, all of which are ICC member states. The ICC doesn't have any powers to compel countries to arrest him and can only tell them they have a legal obligation to do it.

In March, the ICC halted proceedings against Kenyan President Uhuru Kenyatta after the prosecution said it did not have enough evidence against him. Kenyatta, who is attending the summit, was charged in 2011 as an "indirect co-perpetrator" in post-election violence that left more than 1,000 people dead in 2007 and 2008. He always maintained his innocence.

Kenyan Deputy President William Ruto is on trial for crimes against humanity in the election-related violence.