MARYLAND — Students who attend public or private colleges in Maryland were granted an extra layer of online privacy protections on Tuesday when Gov. Larry Hogan signed a law to shield their private social media accounts from administrators’ reach.

The law, which saw overwhelming support in both the Senate and House of Delegates, prohibits college officials from requiring or asking students to grant access to their private social media accounts. The rules, which go into effect June 1, also apply to college applicants and prospective students.

While the law shields colleges from legal liability over students’ online speech, it also gives students legal grounds to sue a university if officials break the rules.

“With access comes responsibility, so without access they don’t have responsibility,” said Bradley Shear, a Maryland-based attorney who specializes in social-media law and has advocated for similar protections nationwide.

In 2012, Maryland became the first state to prohibit employers from requiring employees and job applicants to provide access to their social media accounts. While 18 states followed Maryland’s lead to ensure the social-media privacy of employees, it became the 13th state to extend similar protections to students.

“It was because of the introduction of the bill in Maryland, that’s how the whole thing got started, so even though it’s just now being passed and enacted, it was the first state to introduce the legislation back in 2012,” Shear said.

The legislation was among 350 bills Hogan signed into law during a ceremony on Tuesday.

Under the law, universities are still allowed to access information that is publicly available or accessed through university-owned computers or networks. It also does not prevent a student or third-party from sharing information with officials.

Postsecondary schools were also included in the legislation’s language when Sen. Ronald Young, a Democrat, proposed the rules in February, but a House amendment narrowed its focus on colleges. Young did not respond to questions about the law.

“My hope is that eventually K-12 students will be protected, but obviously you’ve got to take one step at a time,” Shear said. “Sometimes you have to go for half of a loaf instead of the full loaf.”

Another house amendment — in response to concerns from the University System of Maryland — allows college officials to access students’ social-media accounts for educational purposes, such as class assignments.

According to the university system’s 2015 legislative session summary, the system was concerned the legislation could prevent universities from investigating allegations of student misconduct, including “legitimate academic and behavioral concerns such as sexual misconduct and academic integrity. Institutions need the ability to access private electronic accounts for investigations.”

At the request of the General Assembly, the university system established a similar policy in 2013 that “recognizes the importance of privacy in a student’s’ personal activities involving the use of social media.” Under the policy, each institution was required to write policies that prevent university employees from requiring a student to give access to their social-media accounts.

But that policy, Shear said, did not have any “legal teeth” because it did not shield institutions from legal liabilities, “whereas a new law can and will.”

Contact SPLC staff writer Mark Keierleber by email or at (202) 833-3614.