NAIROBI (Reuters) - A Kenyan court on Thursday revoked the deportation of a lawyer who “swore in” opposition leader Raila Odinga as the country’s “president”, a ruling likely to worsen relations between the judiciary and President Uhuru Kenyatta’s government.

FILE PHOTO: Kenyan opposition leader Raila Odinga (C) of the National Super Alliance (NASA) is flanked by lawyer Miguna Miguna (L) and James Orengo as he takes a symbolic presidential oath of office in front of his supporters in Nairobi, Kenya January 30, 2018. Picture January 30, 2018. REUTERS/Baz Ratner/File Photo

Miguna Miguna, who holds dual Kenyan and Canadian citizenship, is currently in Canada after being put on a flight to Toronto by the Kenyan government last week following several days in police detention.

A High Court judge declared Miguna’s deportation order illegal and ordered the government to surrender his Kenyan passport, which was seized when he was deported. The judge gave the government seven days to comply.

The government said the ruling was “not in the best interest of the country”, adding it would appeal shortly.

“The government still holds its earlier stated view that the deportation of Mr. Miguna Miguna was procedural and done in accordance with the law,” Karanja Kibicho, the principal secretary in the ministry of interior said in a statement.

Miguna’s expulsion came after he was charged with treason over the “swearing-in” ceremony. The High Court in Nairobi had issued several orders that he be allowed to appear before it, which the government ignored.

The case exposed a deepening rift between Kenyatta’s government and the judiciary, which had nullified his initial re-election and ordered a repeat election, which Odinga then boycotted.

Odinga justified his “swearing in” by saying he had won the initial Aug. 8 election which was then invalidated by the Supreme Court.

Last week, Raphael Tuju, the secretary general of Kenyatta’s Jubilee party, wrote a letter to the Chief Justice David Maraga, accusing the judiciary of favoring the opposition whenever disputes are brought before it.

He cited eight recent instances, which he called “evidence of bias, double standards, impunity and poor leadership on the part of the judiciary”, including Odinga’s boycott of the repeat vote, which Maraga did not condemn.

Last week, Maraga sharply criticized the government for failing to comply with court orders in relation to the Miguna case and others.

The office of the chief justice said declined to comment on the letter.

But Miguna welcomed the court ruling, tweeting: “(We) are fully committed to the rule of law. We shall use the constitution as the spear and the shield in the fight.”