A Kenyan opposition lawyer charged with treason over the symbolic presidential "swearing in" of opposition leader Raila Odinga has left the country, a government agency said, while his lawyer said he had been deported.

Miguna Miguna was arrested on Friday. He was granted bail of 50,000 Kenyan shillings ($500) but had remained in police custody with his whereabouts unknown until he appeared in court in Kajiado County, neighbouring Nairobi, on Tuesday to hear the charges.

Miguna refused to enter a plea, saying his case should be heard in a court in Nairobi. On Tuesday, High Court judge Luka Kimaru ordered that all proceedings against Miguna be stopped until police brought him to a Nairobi court, as ordered, on Wednesday.

"Miguna is headed home. The court ordered he gets released and @InteriorKE obeyed the orders and even assisted him with a flight ticket home. Please note he renewed his Canadian Passport on 16th June 2017," Nexus, an official government news site based in the president's office, said on Twitter.

Miguna's lawyer, Nelson Havi, said Miguna had been deported and questioned the move since he also holds Kenyan citizenship.

"Deportation is in the nature of proceedings. So if the government of the Republic of Kenya is undertaking the deportation of Miguna, that is a clear contravention of the order that was issued by Justice Kimaru," Havi said on KTN News.

"We will still appear before court tomorrow (Wednesday) at 11 am to get confirmation as to why the police have decided to disobey this court order."

Miguna ran for elected office in 2017, which would have required that he have Kenyan citizenship.