The Trump administration challenged a state university’s longstanding rules against harassment, bullying and bias on Monday, saying that the rules discouraged students from expressing their views and left students open to the possibility of penalties for engaging in free speech.

The Justice Department made the claims against the University of Michigan, the state’s prestigious, historically liberal flagship campus in Ann Arbor, in a federal court brief that supported a student group, including students who said they were abused for wearing red “Make America Great Again” hats and for supporting President Trump.

The student group, Speech First, which formed in February, sued the University of Michigan in May, accusing the school of violating its members’ constitutional right of free speech.

“Instead of protecting free speech, the university imposes a system of arbitrary censorship of, and punishment for, constitutionally protected speech,” John M. Gore, an acting assistant attorney general, wrote in the 25-page brief filed in Michigan’s Eastern District.