Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The University of Texas' giant main campus in Austin will allow handguns in classrooms, the school's president said Wednesday — even though he opposes the idea.

Gregory L. Fenves, who became president of the university last June, just two days after Texas Gov. Greg Abbott signed a law allowing concealed handguns on Texas' college campuses, called the decision his greatest challenge so far, in a letter to the campus.

"Let me say that I do not believe handguns belong in a university setting, in a campus environment dedicated to education and research, but nevertheless as president of a public university, I am responsible for implementing" the new law, he said at a news briefing Wednesday.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The law, which takes effect Aug. 1, allows licensed gun owners 21 and older to carry their weapons on campus if they're fully concealed. The university has allowed licensed holders to do that for 20 years, it said Wednesday, but weapons were barred inside buildings, including classrooms.

Fenves said in his letter that he agreed with a report from an advisory task force he appointed, which said that because students spend most of their time in classrooms, continuing to bar guns from classrooms would violate the new law.

The law, known as SB 11, made Texas only the eighth state to allow licensed citizens to carry concealed weapons on college campuses, according to the National Conference of State Legislatures.

Attention was particularly drawn to the main UT campus in Austin, one of the 10 biggest in the United States, with more than 50,000 students, where many student and faculty groups petitioned and rallied against the measure.

Protesters gathered on the West Mall of the University of Texas campus in August on Oct. 1, 2015, to oppose a new state law expanding the rights of concealed handgun license holders to carry their weapons on public college campuses. Ralph Barrera / Austin American-Statesman via AP

"Many parents of current and prospective students have communicated to me their grave concerns about allowing handguns on the UT Austin campus, especially in university housing and classrooms," Fenves wrote in a separate letter (PDF) to University of Texas System Chancellor William McRaven.

"I have significant concerns about how the law will affect our ability to recruit and retain faculty members and students," he added.

But "as president of The University of Texas at Austin, I am responsible for adhering to the requirements of SB 11," he wrote.

The university has said the law will actually affect few of the campus' students. It estimated that fewer than 1 percent of students have licenses to carry in the first place, and it noted that the law doesn't apply to fraternity and sorority houses, private residential facilities or sports facilities.