OCEAN CITY, Md. (AP) — Officials at a Maryland beach resort can now legally ban topless women.

Maryland Attorney General Brian Frosh waded into the controversy that has rocked Ocean City for days. The Washington Post reports that Frosh said Thursday that requiring women to cover up on top while allowing men to expose their chests does not violate state or federal constitutions.

READ MORE: Johns Hopkins' Bloomberg School Shortens Commencement In Response To Record Heat

Last week, the head of the beach patrol said lifeguards will no longer approach and scold women who are topless. Some on social media incorrectly assumed this meant toplessness would be allowed.

READ MORE: Maryland Weather: Heat Is Here, Alert Day Tomorrow For Record Heat

Ocean City officials, fearing for their resort’s family-friendly reputation, unanimously passed an ordinance in an emergency session Saturday barring topless women.

Follow @CBSBaltimore on Twitter and like WJZ-TV | CBS Baltimore on Facebook

MORE NEWS: Maryland Weather: Summer Heat Moves In For The Weekend

(© Copyright 2017 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)