Canada will repeal a law that bans anal sex.

The federal government will table legislation in the coming days to repeal a provision in the Criminal Code.

Section 159 reads: ‘Every person who engages in an act of anal intercourse is guilty of an indictable offense and liable to imprisonment for a term not exceeding 10 years, or is guilty of an offense punishable on summary conviction.’

The provision gives an exception for married straight couples and any two people who are 18 or older who both consent to the sex act.

However, the age of consent for oral or vaginal sex is 16.

Egale, the Canada LGBTI charity, has said the law is discriminatory and unconstitutional. It is still in effect in five provinces and three territories.

‘Between 2008 and 2014 in Ontario, 22 people were charged with anal intercourse under Section 159,’ Egale said, pointing out the police takes advantage of the law’s ambiguity and continues to use it to charge people.

Ontario’s Court of Appeal was the first to find Section 159 unconstitutional on the basis of age in the late 1990s, according to The Canadian Press.

Appellate courts in Quebec, Alberta, British Columbia, and Nova Scotia, and at the federal level, followed.

‘A lot of Canadians think that when Pierre Trudeau said “the state had no business in the bedrooms of the nation’ back in the ’60s, that that meant this law was repealed,” said Douglas Elliott, a Toronto-based lawyer and longtime gay rights activist, according to Globe and Mail.

‘But in fact, all they did was create an exemption — an exemption that has always discriminated against gay men.’