Ontario's top court has dismissed a constitutional challenge to the oath of citizenship launched by three permanent
residents who refuse to swear allegiance to the Queen.

The Citizenship Act requires applicants for citizenship to swear or affirm they will be "faithful and bear true allegiance to Queen Elizabeth the Second, Queen of Canada, her heirs and successors."

The three longtime permanent residents had argued before the Ontario Court of Appeal that they oppose the oath on religious or conscientious grounds, arguing the requirement was discriminatory and unjust.

"The purpose of the oath is not to compel expression," wrote Justice Karen Weiler. "But to obtain a commitment to our form of government from those writing to become Canadian citizens. If there is a violation of the appellants' rights to freedom of expression, it is justified."

With its decision issued today, the Appeal Court upheld a ruling in September by the Ontario Superior Court, which dismissed the claim, saying the provision is constitutional, even if it does violate free-speech rights.

Selwyn Pieters, one of the lawyers involved in the case, said the trio will be seeking leave to appeal to the Supreme Court.

He said the case is about upholding constitutional rights and values that are near and dear to Canadians.

With files from CBC News