A South African court will decide on Monday whether Sudanese President Omar al-Bashir should be arrested for war crimes and genocide.
The Pretoria High Court will rule on whether he should be handed over to the International Criminal Court (ICC) who have charged him with the crimes.
President Bashir is in Johannesburg for an African Union (AU) summit.
He is accused of committing war crimes, crimes against humanity and genocide during the Darfur conflict.
The UN says that about 400,000 people in Sudan have died and more than two million have fled their homes since fighting began in 2003.
Government forces and allied Arab militias are accused of targeting black African civilians in the fight against the rebels.
On Sunday, the court ordered Mr Bashir not to leave the country until the case had been heard.
As a member of the ICC, South Africa is obliged to arrest anyone charged by the court. Before the summit, the ICC issued a press statement urging the South African government “to spare no effort in ensuring the execution of the arrest warrant”.
However, South Africa signalled its intent to ignore this by granting diplomatic immunity to all leaders at the summit – which the government argues is standard international practice.
The petition to arrest Mr Bashir was made privately by the Southern Africa Litigation Centre, a Johannesburg-based human-rights group.
The BBC’s Nomsa Maseko reports that lawyers representing the government are expected to argue that the Sudanese president should not be arrested.
President Bashir was welcomed by South African officials as he arrived in Johannesburg. After the court announced it would rule on a request to arrest him, he posed for a group photo with other African leaders.
The High Court initially said it would issue its ruling on Sunday. But it later postponed the hearing until Monday, when the summit is due to end.
There are tensions between the ICC and the AU, with some on the continent accusing the court of unfairly targeting Africans.
The warrants against Mr Bashir, who denies the allegations, have restricted his overseas travel. He has, however, visited friendly states in Africa and the Middle East.
The United States has joined calls for Mr Bashir’s arrest, issuing a statement on Sunday calling on the “government of South Africa to support the international community’s efforts to provide justice for the victims of these heinous crimes”.
Analysis: Andrew Harding, BBC Africa correspondent
South Africa has often shied away from this sort of diplomatic headache, but this time the government has stepped straight, and deliberately, into controversy, courting Western fury by rolling out the welcome carpet for President Bashir.
The South African government must, surely, have foreseen the possibility of a legal challenge. If President Bashir is allowed to return home unimpeded, South Africa’s actions will be bitterly condemned internationally – if less loudly within the continent – as a blow against the credibility of the ICC.
And if Sudan’s president is detained, or perhaps even arrested, then Pretoria will be accused of luring a fellow African leader into a trap. Some would call that a no-win situation.
But it’s clear that South Africa’s government has chosen to flaunt its growing antipathy towards “Western” rules, and towards a court in which so many African leaders now appear to have lost faith.
South Africa’s ruling party, the African National Congress (ANC), has called for the reform of the the ICC arguing that it is “no longer useful for the purposes for which it was intended”.
The court, which sits in The Hague, was set up in 2002 to try cases of genocide, crimes against humanity and war crimes, when national courts could not handle them.
The official theme of the Johannesburg summit, chaired by Zimbabwean President Robert Mugabe, is women’s empowerment and development.
But the political turmoil in Burundi, crisis in South Sudan and recent xenophobic attacks in South Africa were also likely to have featured heavily.
A vibrant writer who gives a great insight on hot topics and issues