CHICAGO (AP) — The city of Chicago released thousands of email messages from Mayor Rahm Emanuel's personal accounts on Wednesday as part of a settlement with a government watchdog organization.

Emanuel's office said it was making public any messages pertaining to city business that were sent to and from Emanuel dating to 2011, when the former White House chief of staff took office.

The disclosure followed years of wrangling between the Better Government Association and City Hall, which argued the messages didn't have to be made public. The watchdog group and the Chicago Tribune also sued the mayor, and two Cook County judges ruled against the city, saying emails sent on private devices aren't automatically exempt from disclosure laws.

Andy Shaw, president and CEO of the Better Government Association, called it a "major step forward" but said "it's unfortunate that it took a lawsuit to produce the transparency we all deserve."

"Use of private email accounts that hide the transaction of public business threatens to render meaningless the open records laws that allow citizens to hold their government accountable." he said.

The debate over whether public business conducted on private devices and accounts should be subject to open records laws has grown in recent years with the explosion of technology such as smartphones. And Democratic presidential candidate Hillary Clinton came under fire for using a private email server when she was secretary of state.

Emanuel's office said a new policy would prohibit city employees from doing business on personal email accounts and require them to forward any work-related messages to their government account so they would be subject to public record searches. The mayor's private account will be reviewed quarterly and any messages pertaining to official business sent to the city.

"The new standard we have set clarifies questions not just for me, but for all of Chicago's 30,000 employees," Emanuel said in an emailed statement.

Chicago Tribune publisher and editor-in-chief Bruce Dold said in a Wednesday statement that the newspaper hadn't reached an agreement with the city to settle its September 2015 lawsuit. He noted the newspaper's "significant legal victory" this month when a Cook County judge ordered the city and Emanuel to provide an index of emails and text messages the mayor sent on personal devices.

Dold said he welcomed the release of the records, though it "should not have required extended legal action to protect the public's right to this information."