KAMPALA (Reuters) - Three Ugandan lawmakers and dozens of others critical of President Yoweri Museveni have been charged with treason over their alleged role in the stoning of his convoy earlier this week.

FILE PHOTO: Ugandan President Yoweri Museveni attends an African Union summit in Addis Ababa, Ethiopia, Jan. 28, 2018. REUTERS/Tiksa Negeri/File Photo

Another lawmaker was charged separately in a military court martial.

One of the vehicles in the long-ruling Museveni’s convoy had its rear windscreen smashed when he traveled late on Monday to campaign for a ruling party candidate in a parliamentary by-election in the northern town of Gulu.

Museveni said on Wednesday he was unharmed, but five MPs were arrested in the moments after the incident.

Three of them, including the independent Kassiano Wadri who won the by-election, appeared in court in Gulu and were charged together with dozens of others.

They were accused of “intent to do harm to the person of the president,” according to the charge sheet, which also said they “unlawfully aimed and threw stones, thereby hitting and smashing the rear windscreen of the presidential car”.

A magistrate told the defendants they could not enter pleas as their offense, classified as treason under the penal code, could only be heard in a higher court. He ordered that they be detained until Aug. 30.

Medard Sseggona, a lawyer for the defendants, told the magistrate that some of the accused had been “badly beaten and tortured during the process and after arresting them” by soldiers.

He asked the magistrate to allow the sick among the accused to have immediate access to medical care. That request was granted.

Two other lawmakers, Francis Zaake and Robert Kyagulanyi, a popular musician-turned-politician who goes by the stage name Bobi Wine, did not appear in court.

On Wednesday, a leading opposition figure said Zaake had been severely beaten, as unverified images purportedly of Zaake lying on a bed emerged on social media.

Relatives and opposition MPs who traveled to Gulu to attend the court proceedings said they had been denied information on the whereabouts of Zaake and Kyagulanyi.

A statement from the Ugandan military late on Thursday said Kyagulanyi had been arraigned in a court martial in Gulu, charged with unlawful possession of firearms and ammunition, and would be held until Aug. 23.

Under Ugandan law, civilians found in possession of materials typically reserved for the armed forces are tried by courts martial.

Rights activists have long accused Museveni’s government of using tactics including beatings by security forces and detentions to stifle opposition to his rule.

Museveni has been in power for more than 30 years and officials say he has broad public support.

Last year parliament, dominated by Museveni’s party, scrapped an age limit of 75 on candidates for the presidency, a move critics say means Museveni could potentially rule for life.