Uganda's adultery law has been scrapped by the Constitutional Court because it treated men and women unequally.
Women who broke their wedding vows could have gone to jail
The law made it an offence for a married woman to have an affair, but it allowed a cheating husband to have an affair with an unmarried woman.
The attorney general said the move may encourage immorality and promiscuity.
In the same ruling, the court also scrapped parts of the Succession Act which gave more rights to men on the death of their wives, than to widows.
The attorney general had asked the court to consider amending the law, should it rule in favour of the women's case.
But the court did not have the mandate to make such amendments, and decided instead to scrap the law completely, says the BBC's Sarah Grainger in the capital, Kampala.
Extra-marital affairs are now legal.
Female lawyers brought the case against the attorney general arguing that the constitution provides for principles of non-discrimination and equality before the law.
Dora Byamukama of the Law and Advocacy Group for Women in Uganda hailed the ruling as a big success.
"I'm glad that court has moved in this manner because waiting for the courts to construe the law in line with the constitution would have taken a long time and wouldn't be uniform," she said.
She told the BBC under the adultery law, women found guilty of cheating could be fined or receive a prison sentence.
"The adultery law sets different standards and therefore discriminates against women," she told the BBC's Network Africa.
"Both man and woman who are married should be treated the same."
The group had also asked the court to examine sections of the country's Succession Act which dealt with the division of wealth upon the death of a spouse.
Under that legislation, a husband assumed all the wealth of his wife when she died, but a widow was only entitled to a fraction of her husband's assets.
Also, a father could appoint a guardian to his child in the event of his death, effectively removing his widow's authority over their son or daughter.
The court ruled that these sections of the act were also discriminatory and were thus declared null and void.
What are your views? Are there circumstances when men and women should be treated differently before the law? Have you been the victim of "sexist" laws in Africa? Send us your comments using the postform below or you can also send an SMS text message to +44 77 86 20 50 75.
A selection of your comments will be published below and broadcast on the BBC's Focus on Africa on Saturday 7 April at 1700 GMT.
It is unbelievable that the country has come up with legalisation of adultery. From being a point of reference in the fight against HIV to legalising adultery. Talks of legalising prostitution will soon be the talk. All these are against the teachings of the bible and our cultures. When shall we learn a lesson and not repeat mistakes?
Mutto Robert, Arua, Uganda
The law was unnecessary. There is absolutely no reason to treat men better, like the Koran advocates. Both genders should be given the freedom to make life choices so it's primitive to me, that adultery should be made illegal. Whether a man or women goes around sharing bed with another person is not the State's business. This should be a personal issue between men and wife so let them scream and fight over it. But, the State should not intervene unless there's resulting domestic violence because governments around the world should do a better job at whatever they were meant to do.
Tan Chong Yew, Singapore
I think the state should not worry too much about what the citizen think or act in their private lives. There is no need for any such law - it is for the man/woman to decide and choose how he/she may want to live...including morality.
It is sad that a country whose motto is for |God and my country stand at such a point! I am amazed that some people consider it victory, without realizing what these could mean morally to this country. If only they'd said, make it equal, but not scrap it, Uganda, let us come back to what we believe, "for God and Our country"
bobson rugambwa, Kabale, Uganda
The whole issue of legalisation of adultery to provide for equal rights for men and women are ridiculous. Equal rights do not mean equal rights to do sinister activities.
Masoud, Ipswich, UK
Welcome to the 21st century, Uganda! Biblical moral views have no place in the penal code... This may have been normal under the Spanish Inquisition but I hope we have moved on from there.
John Cahill, London
What does the law promote? Is it Promiscuity? Or to uphold moral values? It sounds unbiblical and absolutely wrong to give an edge to a man to cheat on his wife. I suppose marriage is an institution that uphold moral and not irresponsibility in a society
Gerald , London, England
As a Muslim, the Islamic Sharia forbids committing adultery whether married or unmarried. If a married person commits adultery let it be man or women, stoning to death hangs on him/her. But unmarried persons are subject to flogging. No jail terms, no discrimination. A good justice.
As most of the Ugandans are Christians the laws should enacted according to the values of the bible? Christianity never said a woman should be less than a man .Since they are couple their spouse rights should be the same after death matters.
robert santo, khartoum
What a completely crazy ruling. I mean, of course it's disgraceful for women to be treated worse than men if they had an extra-marital affair, but instead of imposing stricter rules for men and defending the institution of marriage, they relaxed the law for women. Cheating is now legal!? So we're equal now. But are we really better off?
Tim Chu, London, UK
I feel this law was to discriminate women, in most cases women are honest to their husbands, Men are most dangerous creatures in the world, and they can do anything to satisfy themselves. We married woman we are scared to just go out and do things which most man are doing, e.g. go to pubs, working late, ignoring the family at all times a women is home to make sure that the house is in order, instead this law is suppose to be on man not women
Gloria, Gaborone, Botswana
I totally object to the legalization and support for adultery. Aside from biblical condemnation it is morally unethical in African context. This is absolutely crazy in this jet age of ours and the outbreak of so many venereal diseases. Let us as African's show by example self respect, respect for others and above all respect for our most high God. However, I'm totally against punishment discrimination on gender for adultery committed for it's a sin.
NDUKWE VALENTINE, LAGOS, NIGERIA
There are tremendous circumstances that openly treat women differently and usually negatively. For example when the man dies in Sudan, the brother or the nearest of his relative should continue on his brother's sake to marry the widow. Are traditions and Laws partners in conspiracies?
Mary Lodira, Birmingham United Kingdom
I feel it was not fair that the Law treated women unequally but I also feel they should have amended that law rather than scraping it.
Michel Nyamoga, Lusaka, Zambia
The BBC may edit your comments and not all emails will be published. Your comments may be published on any BBC media worldwide.