By Jon Herskovitz

AUSTIN, Texas (Reuters) - Three University of Texas professors have filed suit in federal court in a bid to halt a state law that lets people with concealed handgun licenses bring pistols into classrooms, saying the measure would have a chilling effect on academic freedom.

The law, passed by a Republican-led legislature and signed by a Republican governor, is due to take effect on Aug. 1. The lawsuit was filed in U.S. district court in Austin on Wednesday.

The law permits concealed-handgun license holders 21 and older to bring handguns into classrooms and buildings throughout the University of Texas system, one of the nation's largest, with an enrollment of more than 214,000 students.

"Compelling professors at a public university to allow, without any limitation or restriction, students to carry concealed guns in their classrooms chills their First Amendment rights to academic freedom," the lawsuit stated.

The lawsuit filed by professors Jennifer Lynn Glass, Lisa Moore and Mia Carter names defendants including the state's Republican attorney general, the school's president and the university's board of regents.

Attorney General Ken Paxton said the law is constitutionally sound and he will defend it.

"This lawsuit is not only baseless, it is an insult to the millions of law-abiding gun owners in Texas and across this country," Paxton said in a statement.

The professors argue that they discus controversial and emotionally laden subjects such as reproductive rights, and it would be inevitable for them to alter their classroom presentations because of potential gun violence.

There has been heightened concern about gun violence on U.S. college campuses after several mass shootings in recent years.

University President Greg Fenves in February approved plans for holders of concealed handguns to bring pistols into classrooms, saying he had been forced to do so by the new law.

University officials said they were reviewing the lawsuit and typically do not comment on pending litigation.

Texas Governor Greg Abbott has said the law could prevent mass shootings because someone with a licensed concealed weapon could confront a gunman.

The so-called campus-carry law allows private colleges to opt out, and most of the state's best-known private universities have done so, saying the measure runs counter to protecting student safety.

Eight states allow people to carry concealed weapons on public post-secondary campuses, according to the National Conference of State Legislatures.

The Texas law takes effect on the 50th anniversary of one of the deadliest U.S. gun incidents on a U.S. college campus. Student Charles Whitman killed 16 people by firing from a perch atop the clock tower at the University of Texas at Austin in 1966.

(Reporting by Jon Herskovitz; Editing by Will Dunham)