(Reuters) - The U.S. Justice Department has reached a settlement with dozens of conservative groups that claimed the Internal Revenue Service unfairly scrutinized them based on their political leanings when they sought a tax-exempt status, court documents showed.

In a pair of lawsuits filed in federal court in 2013, the conservative groups accused the IRS of targeting organizations with such words as “Tea Party” or “patriots” when they applied to the agency for tax-exempt status starting in 2010.

The sides asked the United States District Court for the District of Columbia on Wednesday to issue a declarative judgment in one of the cases involving 41 plaintiffs that would say the IRS was wrong to apply the United States tax laws based on an entity’s name, position or association with a particular political movement.

“We hope that today’s settlement makes clear that this abuse of power will not be tolerated,” Attorney General Jeff Sessions said in a statement on Thursday.

The IRS admitted it was wrong when it based screenings of the groups’ applications on their names or policy positions, subjected the groups to heightened scrutiny and delays and demanded unnecessary information from the groups, the agreement in the Washington case said.

The IRS “expresses its sincere apology,” it said.

Senior management within the IRS’s Exempt Organizations Division “was delinquent in its responsibility to provide effective control, guidance, and direction over the processing of applications for tax exempt status filed by Tea Party and other political advocacy organizations,” the settlement document said.

A request to halt the other case, a class action suit involving 428 members, was filed in a federal court in Ohio.

Republicans claimed the targeting of conservative groups showed political bias in the IRS under former Democratic President Barack Obama. House Republican investigators found no connection to the Obama administration, according to a 2014 report.

But the report did blame IRS officials for mistreating conservative organizations who sought tax-exempt status and that IRS officials covered up the misconduct and misled Congress.

The officials included former Commissioner Douglas Shulman, former acting Commissioner Steven Miller, and Lois Lerner, the former head of the unit overseeing applications for tax-exempt status.

Obama fired Miller after an internal 2013 IRS audit released found poor management - not partisan politics - led to an “inappropriate” focus on conservative groups.

No criminal charges were ever filed against IRS officials.

Groups seeking tax exemption under federal law may engage in limited amounts of political activity, depending on the type of exemption sought. That and the vagueness of the rules often make it difficult for IRS agents to tell which groups overstep and become ineligible for exemption.