ACS Education Services, a company that once managed one of the largest portfolios of student loans, will pay Massachusetts $2.4 million to settle charges of abusive collection practices and sloppy handling of accounts, the state attorney general’s office said Tuesday.

Student loan servicing companies such as ACS have drawn the ire of consumer advocates and liberal lawmakers who say the firms are not doing enough to help people struggling with education debt. Servicers are paid millions of dollars by the federal government and private lenders to collect monthly payments, answer questions and ultimately keep people from defaulting on their loans. Yet state and federal authorities have said some servicers are falling short of those aims.

In the case of ACS, Massachusetts Attorney General Maura Healey said the company delayed processing applications for income-driven repayment, a federal program that caps monthly student loan payments to a percentage of a borrower’s earnings. She alleged the company charged some borrowers excessive late fees on suspended accounts and flooded others with a barrage of debt collection calls in violation of the law. ACS also failed to comply with a federal law that caps interest rates for active-duty troops at 6 percent, according to the complaint.

“ACS . . . regularly undermined the opportunity for students to access appropriate repayment plans,” Healey said in a statement. “This conduct increases the already high cost of education, damages credit and prevents students and their families from achieving long-term economic security.”

A portion of the $2.4 million fine will be paid as restitution to hundreds of Massachusetts borrowers who applied for but were unable to successfully enroll or remain in an income-based repayment plan. ACS has already credited any late fee overcharges, refrained from calling borrowers more than twice a week and reformed the accounts of affected military personnel, according to Healey’s office. The company must also review the applications of borrowers rejected from the income-driven plans, as a part of the settlement.

Healey said ACS, owned by Xerox, cooperated fully with her investigation.

Xerox spokesman Kevin Lightfoot noted that ACS did not admit liability, though officials have worked closely with Healey’s office to address her concerns.

“The company enhanced its loan servicing practices . . . and formed a [group] to assist borrowers seeking reductions in monthly payments based on their income,” he said. “Xerox looks forward to continuing to work with its clients to find other ways to enhance its services to student loan borrowers.”

When Xerox acquired it in 2010, ACS was the sole servicer for all of the education loans made directly by the federal government, with a contract valued at about $2 billion. Even when government hired other companies to handle the surge in direct loans, ACS continued to manage a portion of the portfolio and debt originated through a defunct bank-based program. All this, despite consumer complaints of account errors and miscalculated payments.

As complaints mounted, the Department of Education in 2013 transferred all of the direct loans ACS managed to other servicers. Still, ACS continues to service federally backed loans on behalf of banks such as Wells Fargo and JPMorgan Chase. That portfolio was the subject of a remediation plan instituted by education officials and the Consumer Financial Protection Bureau last year, after ACS alerted the agencies to overcharging borrowers.

Education spokeswoman Kelly Leon said the department is “working to address and investigate” the company’s servicing of the old bank-based loans.

Want to read more about the student loan servicing? Check out these stories: