Editor's note: This story has been updated throughout.

* Correction appended.

Save for some narrow exceptions, guns will be allowed in classrooms but not in dorms at the University of Texas at Austin next school year under guidelines reluctantly issued by university President Greg Fenves on Wednesday.

Fenves submitted the rules to comply with the state's new campus carry law, which goes into effect Aug. 1. The law, Senate Bill 11, allows the concealed carrying of weapons in public university buildings by license holders across the state. But it gave universities the power to create limited rules that designate some "gun-free zones" in areas where it would be too dangerous to have weapons. Those zones must be limited in scope, however, and can't have the effect of making it practically impossible to carry a gun anywhere on campus.

In separate letters to UT System Chancellor Bill McRaven and the university community, Fenves said he opposes the idea of guns on campus. But the law gives him no choice, he said. That has made the process of writing the rules the most difficult thing he has done since becoming president last year, he said.

"As a professor, I understand the deep concerns raised by so many," he wrote in his letter to faculty, students and staff. "However, as president, I have an obligation to uphold the law.”

Fenves' rules will ban guns in dorms except for three specific exceptions: Concealed handguns will be allowed in dorms' common areas; people who work in the dorms will be able to carry; and family members visiting the dorms will also be allowed to carry.

While no classroom ban will be imposed, faculty members who don't share an office with anyone else can ban guns in their specific areas, Fenves said.

He also issued strict rules for how those guns can be carried. In most cases, students and other people carrying guns must keep the weapons "on or about their person" at all times. If people aren't carrying their guns, they'll have to keep them in their locked cars. Gun safes will only be allowed in one place — university apartments, which are mostly reserved for families and graduate students.

All guns that are being carried will have to be kept in a holster that protects the trigger. The gun can't have a bullet in its chamber. And it can't be visible; the state's new open carry law doesn't apply to college campuses.

Several other areas of campus will also have gun bans, including daycare centers, labs where dangerous materials are stored and health care and counseling facilities.

The law put university presidents in charge of making the rules, but the schools' boards of regents have the power to change them with a two-thirds vote. A UT System spokeswoman said that its board will review — but not necessarily take action on — all of its schools' plans later this spring. Fenves and other university presidents have consulted with system officials throughout the rule-making process.

Campus carry has been one of the most controversial issues in years at colleges across the state. Private universities were given the choice about whether they wanted to comply. So far, 24 private schools have opted out of the new law; none have opted in.

Meanwhile, opposition has been especially strong at UT-Austin. The university's faculty council passed numerous resolutions against allowing guns in classrooms. The college's only Nobel Prize-winning faculty member has promised to flout the law and ban guns in his class no matter what Fenves' rule said.

But a task force convened by Fenves decided that a classroom ban went too far. Many students come to campus solely for the purpose of attending class, so a classroom ban would prevent them from carrying their guns at all. The task force considered setting up storage areas for guns but decided that would pose too much of a security risk or chance for accidental firings.

The dorm ban is different. State leaders, including Attorney General Ken Paxton, have argued that guns should be allowed in student housing, too. But the task force reached a different conclusion, saying few of the people old enough to have a concealed handgun license — you have to be 21 to obtain one in Texas — actually live in dorms.

The response to Fenves' rules shows how narrow a line he had to walk. People on both sides of the debate expressed anger about his decision. And both sides hinted that they'll consider suing the university to force a change to its rules. That aligns with McRaven's prediction earlier this year that UT System schools will be sued no matter what they decide.

Students for Concealed Carry argued in a statement that the gun-free office policy and the requirement that guns be carried with empty chambers "will not stand up to legal scrutiny." The group said its Texas chapter "will shift its focus to litigation."

"Unfortunately, UT-Austin President Gregory Fenves chose to punt the issue to the courts rather than stand up to a cabal of fear-mongering professors," the group said.

Members of the group Gun Free UT, meanwhile, were upset about the choice to allow guns in classrooms. Professor Joan Neuberger, one of the leaders of the group, said Wednesday that the group is still reviewing its legal options but has retained lawyers in the case.

"I am outraged that my university president and my university chancellor interpreted their right to make decisions at my university so narrowly that they felt they could not allow us to ban guns in our classrooms," Neuberger said in an email. "And I am very sad that the community where I have lived and worked for more than twenty years will become — has become — a more dangerous place."

Fenves, meanwhile, acknowledged the frustration but indicated that there is little he can do.

"Since this is a new law with an unknown effect on UT Austin, we will monitor implementation and its impact on students, faculty members, and staffers," Fenves wrote to McRaven. "I have significant concerns about how the law will affect our ability to recruit and retain faculty members and students. If problems develop, we will work to understand the causes and make adjustments to the policies, rules, and practices, consistent with the law."