Maryland Gov. Martin O’Malley has signed legislation banning employers in the state from requiring workers and prospective employees to disclose their user names and passwords to Facebook, Twitter and other personal social media accounts.

State legislators approved the bill, SB 433 (HB 964), last month, and O’Malley signed it into law Wednesday. It takes effect Oct. 1.

Maryland’s Facebook law was signed into law on Wednesday. (Rainier Ehrhardt/GETTY IMAGES)

Employment law experts say the move sets important limits on employers’ ability to monitor their workers’ online networks — and that of friends and family — at a time when social media plays an ever-increasing role in people’s personal and professional lives.

“It not only protects the employees’ privacy, it also protects employers from creating new legal duties and liabilities and compliance costs,” said Brad Shear, a Bethesda attorney who worked with state Sen. Ronald Young (D-Frederick) to propose the legislation. “It creates a bright line as to what employers can and can’t do.”

The law stems from an incident between former corrections officer Robert Collins and his then-employer, the state’s Department of Public Safety and Correctional Services. During a recertification interview with a supervisor, Collins was asked for his Facebook log in information. A department policy that at the time allowed supervisors to ask prospective employees for passwords to their Facebook accounts as part of a background check to screen for gang affiliations. The department suspended the practice after the American Civil Liberties Union of Maryland filed a complaint on Collins’s behalf, claiming the practice violated his personal privacy.

The Maryland Chamber of Commerce opposed the bill, saying that employers “have a myriad of legitimate interests in knowing what their employees or applicants have posted about themselves,”such as making sure employees are not posting trade secrets or negative comments about customers, using illegal drugs or engaging in other inappropriate behavior.

But a spokesperson for the business group said Thursday they will move forward helping employers comply with the new law.

“The law is the law,” said spokesperson Will Burns. “At this point, our goal is to ensure that all businesses know about it so they can adjust any policies that may be contrary to it.”

View Photo Gallery: Facebook filed for its initial public offering Feb.1, giving us more insight how the tech titan operates. Here’s a look at some of the social networking giant’s shareholders and their affiliations with the company.