WASHINGTON — The Trump administration has agreed to what a lawyer described as a "very substantial" payout to hundreds of tea party groups to settle a class-action lawsuit over the extra, often burdensome IRS scrutiny they received when applying for tax-exempt status during the 2012 election.

The settlement would end a chapter in a political scandal that dogged the Obama administration and continues to irk Republicans. In settling the case, the Trump administration is agreeing to government payments to groups that share its political beliefs. The conservative, anti-establishment tea party movement was something of a precursor to Donald Trump's populist, America-first presidential campaign.

Announced Thursday, the settlement still needs a judge's approval.

Eddie Greim, a lawyer representing more than 400 groups in a class-action suit, described the financial settlement as generous but would not elaborate because details remained sealed Thursday. The Justice Department made no reference to a payout in its announcement.

The department said it is settling a second lawsuit with an apology from the IRS for the intensive scrutiny of the groups, which argued their constitutional rights were violated when they were singled out based on their political views.

Republicans were outraged in 2013 when the IRS admitted the targeting, in part by zeroing in on groups with words such as "tea party" or "patriot" in their names. Many had their applications delayed for months and years. Some were asked improper questions about their donors and even their religious practices, an inspector general's report found.

The Obama Justice Department announced in 2015 that no one at the IRS would be prosecuted. It said investigators found mismanagement but no evidence that the tax agency had targeted a political group based on its viewpoints or obstructed justice.

Republicans were disappointed again when the Trump Justice Department, under Attorney General Jeff Sessions, said it would not reopen its case against Lois Lerner, who had led the IRS office that processes applications for tax exempt status.

Still, Sessions condemned the misconduct in a statement announcing the settlements.

"There is no excuse for this conduct," Sessions said. "Hundreds of organizations were affected by these actions, and they deserve an apology from the IRS.

The groups that sued were "very pleased" with the settlement outcome, Greim said.

"It's a great day for the First Amendment and the promise of a fair and impartial government," he said in a statement. "But this day was too long in coming."

Much of the agency's leadership, including Lerner, resigned or retired over the scandal. One of the proposed agreements calls senior management "delinquent" in providing control and direction over the process. It faults Lerner for failing to tell upper-level management of the long delays in processing applications from tea party and other conservative groups.

"These cases against the IRS shouldn't have happened in the first place," Sessions said during a speech at the Heritage Foundation. "They never would have been necessary if government had acted properly."

__

Associated Press writer Dan Sewell in Cincinnati contributed to this report.