Uganda on Monday designated the red beret and tunic as official military clothing that could land civilians who wear them in jail, essentially banning the uniform of opposition leader Bobi Wine and his supporters.
The pop star turned leading opposition figure, who has announced he is running for president against long-time leader Yoweri Museveni in 2021, has made the red beret his signature, calling it a "symbol of resistance".
However the beret, also worn by some soldiers, was included in Uganda's first ever gazette of all military clothing, which states that any member of the public found in possession of the items "is liable on conviction to imprisonment for a term not exceeding five years."
"The dress code for the UPDF (Uganda People's Defence Forces) has been gazetted. The action was endorsed by the top organs of the army which also commended the dress committee for concluding the task assigned to it years back," army spokesman Richard Karemire said in a statement.
"It manifests the commitment to define identity and outlook of a professional army as well as adhering to the EAC (East African Community) protocols," he added.
Bobi Wine, whose real name is Robert Kyagulanyi, did not comment on the new rules as he is out of the country.
However a leading figure in his "People Power" movement -- which he has yet to register as a political party -- said they would not stop wearing it.
"We shall continue to wear the revolutionary red berets," said youth leader Ivan Boowe.
"No amount of intimidation will make us fear to exercise our rights. By designating our dress code as a military wear, the government is moving to attempt to ban the People Power Movement and we are ready to face any action government takes," he added.
Kenya banned the wearing of military fatigues - a black berret, pants and jackets of jungle colours - in a bid to fight crime.
The ban has been difficult to enforce because the items are sold in the open market, a challenge Uganda is also likely to face.