State Bank Financial Corp. said Thursday that it had a $2 million loss in the second quarter after exiting a deal with a federal bank regulator to split proceeds from unwinding Great Recession-era loans at failed banks.

State Bank, which has $3.3 billion in assets, had a $7.5 million profit in the year-earlier quarter.

The Atlanta-based bank holding company, which operates 26 banks in and around Atlanta, Macon and Augusta, said it took a $14.5 million charge against earnings for ending the so-called “loss-share” agreement with the Federal Deposit Insurance Corp. in May.

“The big event of the second quarter was the early termination of our FDIC loss share agreements with a related one-time charge that led to negative earnings,” said State Bank CEO Joe Evans. However, he said the move should allow the bank to “recover this charge within five quarters” and reap financial benefits in the future.

In other earnings news, United Community Banks Wednesday reported $17.8 million in second-quarter net income, a 9 percent increase over the year-earlier quarter’s $16.4 million profit.

The Blairsville-based bank holding company, which has $8.2 billion in assets, said strong loan growth and increased fee revenue helped boost its bottom line, partly offset by $3.2 million in merger expenses related to its acquisition of MoneyTree Corp. and its subsidiary, First National Bank, in May.