Zambia's opposition leader has pleaded not guilty to treason charges four months after his arrest for failing to make way for President Edgar Lungu's motorcade.

Hakainde Hichilema, who was first charged with treason for allegedly putting Lungu's life in danger and later accused of plotting to overthrow the government, appeared in a Lusaka court on Monday.

The case stoked political tensions in Zambia after Hichilema and five others were arrested in April.

All six "denied the charge of treason and the state has decided to take the matter to Wednesday for trial," said Charles Kakoma, the spokesman for Hichilema's United Party for National Development (UPND).

He also said that Hichilema, who remained in custody, appeared in good health at the brief hearing.

Police officers in riot gear sealed off the court precinct as scores of UPND supporters waited outside.

Amnesty International has said the treason charges are trumped up and called for his release, as have local church leaders.

A lawyer from UPND earlier told the AFP news agency that the party expected the charges to be dropped and for Hichilema to walk free.

"They don't have a case against him. We are certain that he will come out tomorrow," the party lawyer, who declined to be named, told AFP on Sunday.

READ MORE: Neoliberalism, big capital and the Zambian crisis

Reuters, citing government and legal sources, said Hichilema is to be freed under a deal brokered by the Commonwealth secretary-general.

Patricia Scotland, the Commonwealth secretary-general, visited Lusaka last week and told reporters she had met Lungu and Hichilema separately and that the two leaders had agreed to a process of dialogue facilitated by her office.

'Public interest'

A government source told Reuters that the state would quash the case "in the public interest".

Hichilema and Lungu "are committed to burying their past and starting dialogue envisaged to help address some of the issues the opposition raised after the 2016 elections," the source said.

Political tension has been on the rise in Zambia, seen as one of Africa's more stable and functional democracies since Lungu's Patriotic Front (PF) beat the UPND in a presidential election marred by violence.

Hichilema, 55, says the election was rigged and has refused to recognise the president.

In July, Lungu invoked emergency powers, increasing police powers of arrest and detention after he blamed opposition parties for a string of arson attacks.

He has denied allegations of growing authoritarianism and has accused his rivals of trying to overturn the election result.

Police on Thursday freed another opposition leader, United Progressive Party leader Saviour Chishimba, after holding him in detention for a week on accusations of defaming Lungu, an offence that carries a maximum five-year prison term.

Chishimba hit the headlines in July after criticising Lungu's decision to impose emergency powers and suggesting the president should go to hospital for mental tests.