HELENA, Mont. — A federal judge has upheld the constitutionality of Montana’s law prohibiting most robocalls after a challenge by a political consulting firm that sought to do business in the state.

Victory Processing LLC of Grand Rapids, Michigan, and Dave Deshaw filed a complaint last year arguing the state law violated their right to free speech and hampered their ability to convey political messages to Montana voters.

U.S. District Judge Charles Lovell ruled Friday the U.S. Supreme Court has repeatedly ruled individuals are not required to welcome unwanted speech into their homes and the government may protect that freedom.

The ruling also notes the state law allows recorded calls to be made if a live operator first receives the recipient’s permission or if there is a prior business relationship between the parties.