BOSTON (AP) — A California-based finance company has agreed to pay more than $900,000 to settle allegations that it was illegally leasing dogs in Massachusetts, the state attorney general’s office said.

As part of the agreement entered in Suffolk Superior Court on Wednesday, Monterey Financial Services LLC will stop collecting on active leases, cancel about $700,000 in outstanding consumer debt on 211 dog leases — about $3,300 owed per lease — and transfer full ownership of the dogs to Massachusetts residents, authorities said.

The company will also provide $175,000 in restitution to consumers and pay $50,000 to the state.

Leasing dogs is illegal in Massachusetts, and can often be an expensive way to own a pet because of high finance charges, according to the attorney general.

Authorities had alleged that the Oceanside, California, firm violated Massachusetts consumer protection laws by purchasing and collecting on leases for dogs, and engaged in illegal practices to collect outstanding balances on those leases.

Monterey in a statement Thursday said it stood by its record of “high levels of performance for our clients, low consumer complaint ratios, and a deep-rooted dedication to customer service.”

“While we disagree with the state’s findings, we have elected to come to an agreement to move away from this issue to best serve our clients,” the statement said. “Monterey has and continues to strive to employ business practices in full accordance with all applicable laws and regulations.”

Leasing a dog is much like leasing a car, the attorney general’s office said. The consumer must make monthly payments for the duration of the lease, plus an additional payment at the end of the lease to ultimately own the dog. Missed payments can result in the dog being repossessed, the office said.

“Families in Massachusetts looking to get a dog should not be trapped in leasing agreements that are harmful, expensive, and illegal,” Attorney General Maura Healey said in a statement.

The attorney general’s office learned of Monterey’s dog leasing practices while it was investigating another financial company, Nevada-based Credova Financial, which agreed to waive more than $126,000 in consumer debt.