Sudanese President Omar al-Bashir arrived in Khartoum on Monday to cheers of supporters after leaving South Africa, where a court had ordered his arrest based on an international warrant for war crimes charges.

Al-Bashir raised a stick in the air as he stepped out of the plane, waving to a few hundred supporters who greeted him at the airport. Some chanted "God is Great" while others cried with joy.

A South African court ruled that al-Bashir, who was attending an African Union summit, should be arrested. The ruling came after he left.

Al-Bashir, in office since a 1989 military coup, is wanted by the International Criminal Court on war crimes allegations linked to the conflict in Sudan's Darfur region.

At the Khartoum airport, supporters of the president raised posters reading "Lion of Africa" scribbled next to a picture of al-Bashir in military uniform and carried a coffin with a white sheet wrapped around it reading: "The ICC to its last resting place."

Sudanese Foreign Minister Ibrahim Ghandour said: "The president will continue his participation (in international events) as usual and the attempts to distract us will not sway us."

In Geneva, U.N. Secretary-General Ban Ki-moon said the International Criminal Court's authority must be respected.

However, a Pretoria court's ruling that al-Bashir should be arrested came after he had left the country and in defiance of an earlier court order that he should remain in the country while judges deliberated on the matter.

Judge Dunstan Mlambo criticized the South African government for failing to heed the instructions of the court.

"It is of concern to this court that we issued orders and then things just happened in violation of those orders," Mlambo said.

International Criminal Court Deputy Prosecutor James Stewart said in an interview with The Associated Press in The Hague, where the court is based, that "in our view it was very clear" that South Africa should have detained al-Bashir so he could have been brought to trial in The Hague.

"Their obligation was to arrest President al-Bashir," Stewart told AP.

"I think, however, what is important to remember is that we act really in the interest of victims," he added. "The concern of the prosecutor is for the victims of dreadful atrocities and these victims are Africans."

The International Criminal Court's charges against al-Bashir 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 U.N. figures.

South African officials have declined to comment, though William Mokhari, an attorney for the South African government, said African leaders at the summit in Johannesburg had immunity.

Leaders of the African Union are cautious about interfering in each other's affairs and highlighting alleged human rights abuses on a continent with a history of conflict. Critics of the International Criminal Court also say it has unfairly targeted African leaders. But Stewart said most of the African cases were initiated by African governments themselves.

At one point, Mokhari, the South African government lawyer, told the judges that there was no risk of al-Bashir "disappearing" while he attended the summit.

But soon after he uttered those words, South African journalist Erika Gibson tweeted photographs of what she said was Sudan's presidential jet taking off from a South African military base. Sudanese state media then said al-Bashir had left South Africa and that a news conference will be held at the Khartoum airport upon his arrival.

Elise Keppler, international justice acting director for U.S.-based Human Rights Watch, said an opportunity to bring al-Bashir to justice had been missed.

"By allowing this shameful flight, the South African government has disregarded not only its international legal obligations, but its own courts," she said in a statement.

Al-Bashir appeared in a group photo with other African heads of state on Sunday at the summit. The African Union had previously asked the ICC to stop proceedings against sitting presidents and said it will not compel any member states to arrest a leader on behalf of the court.

In a government notice published June 5, South Africa's minister of international affairs, Maite Nkoana-Mashabane, signed an agreement granting diplomatic immunity to delegates participating in the African Union summit.

The Southern Africa Litigation Centre, a rights group, had gone to court to press for al-Bashir's arrest.

In March, the International Criminal Court 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 in Johannesburg, was charged in 2011 as an "indirect co-perpetrator" in postelection 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.