A UK-based firm has sold surveillance technology to Uganda which has been used to crush and potentially blackmail opponents of the president, according to documents seen by BBC Newsnight.
An internal report claims the technology has also been used in other African countries and in Syria.
The Ugandan government denies the operation exists.
The firm, Gamma Group, says it does not assist or encourage any government agency in the misuse of its products.
Technology companies are duty bound not to sell "off-the-shelf" systems to countries if they have any concerns about how they will be used.
Surveillance systems are not regulated in the same way as arms equipment, an anomaly that has raised concerns among MPs and human rights groups. They fear the technology can be used for internal repression.
Codename Fungua Macho
The BBC has been working with Privacy International, who were leaked a top secret memo and other documents purportedly detailing the use of the technology for the use of internal repression in Uganda.
One top secret document was prepared by a senior intelligence official for President Museveni and describes a surveillance programme codenamed Fungua Macho, which involved more than 70 intelligence analysts.
Dated January 2012, the document says the Finfisher technology bought from Gamma Group International has been used "to spy on the enemy, collect data, intrude enemy systems, intercept enemy communication and also manipulate transmissions.
"It can covertly be deployed in buildings, vehicles, computers, mobile phones, cameras and any other equipment deemed worthy for information extraction or surveillance."
The document says the operation has already gathered "hordes of information revealing secret plans" of the main Ugandan opposition party, the FDC.
It says the aim of the operation is to "to manage and control the media houses and opposition politicians.... which... may involve blackmailing them."
"I am glad to inform you that since we started we have managed to collect substantial amount of information from different targets... people deemed dangerous to state security like government officials and opposition politicians are being surveilled."
The document says the technology "is being used by countries like Nigeria, Rwanda, Zimbabwe, Senegal and most recently Kenya. It is also the main tool that has been employed by the Syrian government; although it came a little too late when the demos were out of hand but has to a greater extent managed to contain the situation."
'No evidence' says government
The BBC asked the Ugandan government to give details of its surveillance operations and explain why it was targeting opposition politicians.
Government spokesman Colonel Shaban Bantariza told Newsnight: "I am not aware of an order having been given or having been authorised to surveil anybody so those who are making that allegation, the onus is on them to prove it that they are being surveilled - that their phones are being tapped. When did they do that? What did they tap? What did they cause? So the onus is on those who are alleging to prove - we have no evidence they are being surveilled."
The Ugandan government, which received £1bn in UK aid and investment last year, did not respond to follow up questions about the surveillance programme.
However, in a letter to Privacy International, a Ugandan government spokesman denied the operation existed.
"President Museveni does not use criminal blackmail as a political tool to win over or deal with opponents... it does not add any value as (the) government enjoys broad political legitimacy and support."
Gamma Group International is a British-based company with affiliates in a number of countries, including Germany. It says it sells surveillance technology to governments for counterterrorism purposes.
In a statement, the company said it was unable to to give details of any alleged orders.
"Gamma undertakes an absolute obligation of confidentiality to the governments which purchase its products and systems.
"Gamma does not assist or encourage any government agency in the misuse of Gamma's products and systems.
"These products and systems have been effective in many countries in the course of police and other government agency action against terrorist threats, drug cartels, other major organised crime, and paedophile rings."
Gamma Group said it has a human rights policy, but declined to share a copy of it.
Gus Hosein, director of Privacy International, said: "The documents say that the surveillance industry will sell to just about anyone. And it is proof of the fact that we have been trying to raise all along - that these technologies are far too powerful to be in the hands of governments and that governments will go ahead and abuse them."
Last year Gamma was criticised in a ruling by the UK National Contact Point for the Organisation of Economic Cooperation and Development. The OECD said the company's approach to selling technology was "not consistent with the general obligations to respect human rights".
Nick Hopkins' full report ran on BBC Newsnight on Thursday 15 October. You can catch up on iPlayer
Update 29 January 2016: The Ugandan government was given 13 days to respond to detailed questions from the BBC about its surveillance programmes before this story was published and did not do so. Since then, the Ugandan government has denied in public, and later in correspondence with the BBC, that it is spying on opposition politicians. It says the documents leaked to Privacy International that purport to set out such activity are fakes.
Gamma says there are inconsistencies in the report around dates and it claims the signatures in the report differ from those in other documents subsequently provided to it by the Ugandan government.
However, the Ugandan government has confirmed that it met representatives from Gamma over a number of days in 2012 and in 2013, but it insists it did not buy any equipment from the firm. The Ugandan government told the BBC: "The government of Uganda wishes to emphasise that the political opposition is Uganda is not an enemy, perceived or otherwise."Gamma says it cannot confirm or deny any dealings with customers.
A spokesman for Privacy International said it stood by the report: "The Ugandan government has in numerous instances alleged that documents have been forged when information unfavourable to it has been made public."
For the avoidance of doubt, we'd like to make clear that a company with a similar name, Gamma Communications, is not related to Gamma Group International - and is in no way involved in this story.