Jacob Zuma, the former president of South Africa, has been sentenced to 15 months in prison for contempt of court after failing to appear before a corruption inquiry earlier this year.

Zuma, 79, who was the president for nearly nine years until 2018, was not present to hear the South African constitutional court deliver its ruling and sentence.

The judge ordered the former president to hand himself in within five days. If he fails to do so, police will be ordered to arrest him and ensure he is “delivered to a correctional centre,” Judge Sisi Khampepe said.

Zuma failed to appear at the corruption inquiry led by the deputy chief justice, Raymond Zondo, in February. The inquiry is examining allegations of high-level graft during Zuma’s period in power. The veteran politician denies wrongdoing and has claimed Zondo is conducting a personal vendetta.

On Tuesday, Khampepe said: “The constitutional court can do nothing but conclude that Mr Zuma is guilty of the crime of contempt of court.”

She added: “This kind of recalcitrance and defiance is unlawful and will be punished. I am left with no option but to commit Mr Zuma to imprisonment, with the hope that doing so sends an unequivocal message … the rule of law and the administration of justice prevails.

“The majority judgment orders an unsuspended sentence of imprisonment for a period [of 15 months].”

Zuma had “repeatedly reiterated that he would rather be imprisoned than to cooperate with the commission or comply with the order made,” said Khampepe.

The corruption inquiry was set up by Zuma himself, under pressure over mounting scandals, shortly before he was ousted in 2018 by the ruling African National Congress (ANC).

But he testified only once, in July 2019, before staging a walkout days later. He ignored several invitations to reappear, citing medical reasons and preparations for another corruption trial.

He presented himself again briefly in November but left before questioning.

In February, Zondo said he would seek an order from the constitutional court that Zuma was in contempt of court and would press for a jail sentence.

“This is very serious because if it is allowed to prevail, there will be lawlessness and chaos in the courts. There may be other people who will decide to follow his example when they are served with summons in other court processes,” Zondo said.

“If the message that is sent out is that people can ignore or disregard summons and orders of courts with impunity, there will be very little that will be left of our democracy.”

Most of the alleged corruption under investigation by the commission involves three brothers from a wealthy Indian business family, the Guptas, who won lucrative government contracts and were allegedly even able to choose cabinet ministers.

Zuma is separately facing 16 charges of fraud, graft and racketeering relating to the 1999 purchase of fighter jets, patrol boats and military gear from five European arms firms for 30bn rand, then the equivalent of nearly $5bn. At the time of the purchase, Zuma was president Thabo Mbeki’s deputy.