Philadelphia District Attorney Larry Krasner has agreed to settle with the city’s Board of Ethics after acknowledging that his 2017 campaign violated city law by accepting $11,020 in excess in-kind contributions and failing to disclose them.

Under the settlement, announced Thursday by the Board of Ethics, Krasner’s campaign will pay a $4,000 fine and reimburse the city for the excess in-kind contribution from Real Justice PAC, a San Francisco-based group that says it works to elect reform-minded local prosecutors across the country.

Real Justice PAC has agreed to pay the city $8,000 in penalties.

“He’s happy to have this resolved,” said Krasner attorney Adam Bonin. “He was happy to cooperate with the board.”

Bonin described the mistake as a “question of a first-time candidate not having all the controls in place to track what a well-meaning group was doing to support him.”

Krasner won the crowded Democratic primary in 2017, with help from liberal groups like Real Justice and an independent super PAC funded by the progressive billionaire George Soros.

Under city law in 2017, a political committee could not contribute more than $23,800 to a candidate for district attorney either in direct campaign donations or in-kind contributions, such as providing a service without charge that benefits the candidate, the Ethics Board said.

Three staffers for Real Justice PAC were embedded with Krasner’s campaign during the Democratic primary, and one of them worked through the general election.

Real Justice, whose treasurer was a senior adviser to Vermont Sen. Bernie Sanders’ 2016 presidential campaign, paid the three staffers a total of $34,820 for their work — $11,020 in excess of the limit imposed by Philadelphia’s campaign finance laws, according to the settlement agreement.

The agreement says Real Justice and the Krasner campaign both knew that the PAC’s spending would count as in-kind contributions, but Real Justice miscalculated how much money would be attributable as such.

The PAC didn’t provide information to the campaign regarding its staff payments, nor did the campaign request it, the agreement says.

The Board of Ethics said it opened an investigation into the matter in June 2018 after it learned of possible violations of the city’s campaign laws.