TALLAHASSEE — Gov. Rick Scott has agreed to pay a Tallahassee lawyer $700,000 in taxpayer money to settle seven public records lawsuits alleging he and members of his staff violated state law when they created email accounts to shield their communications from state public records laws and then withheld the documents.

The lawsuits were filed by Steven R. Andrews, an attorney who has been embroiled in litigation with Scott since 2012, when the governor initiated a plan to have the Cabinet buy a building in which Andrews' firm is located near the Governor's Mansion.

The settlement, first obtained by the Times/Herald Tallahassee bureau, is precedent-setting in that it is the first time in state history that a sitting governor and attorney general have been sued and agreed to settle allegations that they violated Florida's public records laws. It is also the third legal defeat in recent months for the governor, and the second time he has agreed to use state dollars to end a Sunshine Law lawsuit against him. Also signing the agreement is Attorney General Pam Bondi.

"We settled, and it was the right thing to do for the state," said Scott spokeswoman Jackie Schutz.

Bondi spokesman Whitney Ray said the attorney general agreed to settle the lawsuit "to avoid litigation costs."

Andrews would not comment.

Scott and the Cabinet in June agreed to pay $55,000 to St. Petersburg lawyer Matthew Weidner, open government advocacy groups and several media organizations, including the Tampa Bay Times and Miami Herald, who accused Scott and the Cabinet of violating the state's open meeting laws when they allowed staff to use back channels to oust former Florida Department of Law Enforcement Commissioner Gerald Bailey with no public discussion or vote.

"It is clear this governor has made a calculated decision that violating constitutional rights is the cost of doing business — a cost he doesn't have to bear," said Weidner, the lead plaintiff in the case against the governor and Cabinet. "While these numbers are shocking, you can't calculate the cost to citizens of the state for government that is operating in darkness. The real costs will be borne in years to come for a government that operates in contempt of fundamental rights to records."

The Weidner case has cost the state more than $225,000 in legal fees, not including the legal fees from the governor's office. Scott's office has not disclosed how much state money was spent to defend the governor in either the Weidner case or the Andrews lawsuit, despite repeated requests from the Times/Herald Tallahassee bureau.

Barbara Petersen, president of the First Amendment Foundation, which advocates for the state's Sunshine Law, said she was disappointed in the governor.

"Gov. Scott, while touting fiscal restraint and conservatism, has played fast and loose with our constitutional right of access to our government and we Floridians are paying the price, both literally and figuratively," she said.

Andrews first sued the governor and Cabinet in 2012 for violating a contract he had to purchase the building, and, in the process of trying to obtain emails and documents relating to the case, he discovered evidence that the governor and his staff had set up a series of private Gmail accounts and used them to conduct public business.

After numerous attempts to obtain details from the email accounts relating to his case, Andrews sued the governor, alleging he not only withheld documents but engaged in "actively concealing them" and "conspiring with others" to conceal them.

Andrews found that in March 2013, Scott's former chief of staff emailed the governor's private account to urge him to appoint state Sen. John Thrasher as lieutenant governor. Before that, in January 2012, a deputy chief of staff sent a text message to the Department of Education's secretary that said, "Gov just shot me an email that you called. Did you need more clarification from our end?"

Neither of these emails appeared in records requests fulfilled by the governor's office when Andrews requested them, but lawyers for the governor and attorney general repeatedly argued they had turned over all relevant documents.

Scott's former general counsel, Pete Antonacci, also claimed that the state was no longer the custodian of the records held in the private email accounts of the governor's former staff, delaying discovery in the case during last year's heated political campaign.

Andrews was forced to individually sue former members of the governor's executive staff — Brad Piepenbrink, Chris Finkbeiner, Sarah Hansford, Carly Hermanson and Carrie O'Rourke. Representing Hansford, Piepenbrink and Finkbeiner in the case was Tallahassee lawyer and lobbyist Pete Dunbar, who also represented the governor in both the Andrews and Weidner cases. It is not clear whether the state or private parties paid Dunbar's fees.

Andrews also took the case to California, where he got a judge to order Google to turn over the computer IP addresses for all correspondence to and from the governor's private Gmail account.

Asked by reporters if he or his staffers used the accounts to discuss public business privately, Scott issued a blanket denial.

"Absolutely not. We follow the law," he said. He called Andrews "just an individual that sues the state, tries to cause problems."

After a California judge ordered Google to turn over the documents, a trial in the case was scheduled for June. That's when the governor and his lawyers began settlement negotiations, according to court records.

The deal now ends those cases, and Andrews agrees to "permanently abandon and forgo any and all rights to access those records" and refrain from deposing the governor's staffers about them. According to the settlement, Andrews will now dismiss his lawsuit and agree to a statement that he has received all the documents he has requested.

On Wednesday, the governor and Cabinet agreed to settle Andrews' first lawsuit — which will allow Andrews, not the state, to purchase the building that houses his law firm from owner John Aurell. The settlement also requires the state to buy an adjacent lot from Aurell for parking near the mansion for $186,000.

After the Cabinet vote, Andrews agreed to dismiss his remaining pending lawsuits, including a case scheduled for trial last month, in return for a payment. According to the settlement, the bulk of the money to end the litigation — $445,000 — will come from the Department of Environmental Protection budget, another $120,000 will come out of the governor's office, $75,000 will come from the office of the attorney general and $60,000 will come from the Department of State.

The governor's office provided no explanation as to how they determined how to apportion the payment of damages between the various agencies.

Contact Mary Ellen Klas at meklas@miamiherald.com. Follow @MaryEllenKlas.