ANNAPOLIS, Md. (AP) — Maryland residents can seek damages over the improper use of personal records by an elected official, a state appeals court ruled Friday.

The Maryland Court of Special Appeals issued the ruling in a court case involving former Anne Arundel County Executive John Leopold, who resigned in 2013 within days of being found guilty of misconduct in office. The charges related to Leopold using members of his security detail to perform political activities while they were on the job.

READ MORE: 18-Year-Old Charged With Attempted Murder In Southern Baltimore Shooting

The American Civil Liberties Union of Maryland alleged Leopold abused his position to collect personal information about perceived political opponents from the county police department without legitimate law enforcement purposes.

“Without first having `clearly established’ a need for the documents, Mr. Leopold should not have been `using’ them at all, whether he wore his county executive hat or his candidate hat at the time,” Judge Douglas Nazarian wrote in the ruling by the state’s intermediate appellate court.

The court also ruled Leopold could not avoid liability by asserting immunity as a public official.

The ACLU sued under a provision of the Maryland Public Information Act that prohibits the use or dissemination of government records with personal information about private citizens without an adequate governmental need. It also sued under provisions of the law prohibiting wrongful withholding of public information.

READ MORE: Maryland Weather: Muggy With Storms Likely Later On

The ACLU contended that the information was improperly collected. The organization also argued the information was improperly withheld when requested by people who had reason to believe they were targeted.

“This victory on behalf of individuals targeted for wrongful information gathering breathes life into a provision of our state’s public information law that has laid dormant for years,” said Deborah Jeon, legal director for the ACLU of Maryland. “In so doing, the court has put public officials on notice that this type of conduct is unlawful, helping to ensure that such abuses of power will not recur in the future.”

While a general purpose of the PIA law is to encourage disclosure, the law also contains provisions to protect privacy. Nazarian wrote that the privacy protections in the law “would be thwarted,” if mandatory provisions were left with no enforcement mechanism.

A judge in a lower court had ruled the law did not provide civil remedies. Friday’s ruling found that the lower court read the interplay between the provisions “too narrowly.”

MORE NEWS: 'It's A Cane!': Body Camera Footage Sheds New Light On Harford County Deputies' Shooting Of Edgewood Man

(Copyright 2015 by The Associated Press. All Rights Reserved.)