Sudanese President Omar al-Bashir was not immune from arrest when he was in South Africa last year, the Supreme Court of Appeal (SCA) in Bloemfontein heard on Friday.
The State wants the SCA to overturn a ruling by the High Court in Pretoria that the government's failure to arrest him was inconsistent with its constitutional duties.
However, the South African Litigation Centre (SALC) told the court that Bashir was not immune from arrest and South Africa was supposed to be committed to bringing war crimes suspects to book.
When Bashir entered South Africa last June for an African Union summit, the SALC approached the high court for an order that the government enforce an International Criminal Court (ICC) arrest warrant on him. But the government failed to do so.
In his argument, the centre's lawyer, Wim Trengove, said the country should not be a safe haven for people accused of crimes against humanity.
He added: "It is absurd to argue you can only arrest a head of state accused of international crimes by ICC if he waives his immunity."
But Jeremy Gauntlett, for the minister of justice, argued that Bashir enjoyed full immunity from his arrest and the government was not obliged to arrest him.
He also said the Sudanese president was in the country in his capacity as a member of the AU and that heads of state may only be arrested once their terms of office ended, or when they waived immunity.
Judge Caroline Lewis commented that the high court was not asked to prosecute Bashir, but was rather asked to order his arrest.
South Africa is a signatory to the ICC's Rome Statute, which sets out the crimes falling within the ICC's jurisdiction, and the procedures and the mechanisms for states to co-operate with the court.
The ICC had two outstanding warrants for Bashir, issued in 2009 and 2010. It wanted him to stand trial on allegations of crimes against humanity, genocide, and war crimes committed in Sudan's western province of Darfur.
On Monday, June 15, the high court ordered the government to arrest Bashir and said its failure to do so was unconstitutional. Despite this, Bashir was allowed to leave the country.