* President Museveni seen behind the removal of mayor
* Lukwago is allied to president's rival party
* Legal battle will test judicial independence
By Elias Biryabarema
KAMPALA, Nov 28 (Reuters) - Uganda's High Court has reinstated the capital's mayor who was ousted days ago by city councillors in a move widely seen as an attempt by President Yoweri Museveni to assert control over a city where he faces substantial opposition.
The government said it would appeal the High Court's ruling, setting up a legal battle that will be seen as a test of the country's judiciary.
Kampala councillors voted 29-to-three to oust the popular Mayor Erias Lukwago on Monday after a tribunal appointed by the government earlier this month found him guilty of incompetence and abuse of office and recommended he be removed.
Museveni's critics said the impeachment - that sparked clashes on the streets of Kampala - was a power grab by Museveni against Lukwago who is allied with the biggest opposition party, Forum for Democratic Change (FDC).
Lukwago has been a key figure in galvanizing opposition supporters to participate in anti-government demonstrations over the last two years.
The ruling National Resistance Movement (NRM) is concerned about growing opposition support especially in urban centres ahead of 2016 general elections.
"Today the High Court has nullified what took place on Monday (the impeachment). The mayor has been reinstated and is free to go to his work tomorrow," Lukwago's lawyer, Lubega Sseggona, told Reuters.
Museveni, a rebel-turned-president who was lauded by aid donors in the early days of his rule as an economic reformer, remains popular in rural areas of Uganda but his grip on urban centres is weaker.
Government spokesperson, Ofwono Opondo, said Lukwago would not be allowed back into office pending guidance on the ruling by the attorney general.
"This ruling came after the vote and we're not sure it nullifies what took place," he said.
"We have asked the attorney general to offer us guidance on what it means and secondly he's appealing against it."
Uganda has seen intermittent and often bloody anti-government protests over the last two years, fuelled by anger over corruption, human rights abuses and Museveni's refusal to hand over power.
"The judiciary is one front they're using and we're keenly watching to see whether they can stand up to the regime," said Mugisha Muntu, president of the FDC. (Editing by James Macharia and Robin Pomeroy)