The nation’s consumer watchdog agency on Tuesday ordered the credit-reporting agencies TransUnion and Equifax to pay more than $23.2 million in fines and restitution for deceiving customers about the usefulness of credit scores and the cost of obtaining them.

The watchdog agency, the Consumer Financial Protection Bureau, said the payments would resolve charges that TransUnion and Equifax had lured consumers into enrolling in credit services advertised as free or costing only $1, but which could cost more than $200 a year.

TransUnion will reimburse $13.93 million to consumers and pay a $3 million civil fine, while Equifax will reimburse $3.8 million and pay a $2.5 million civil fine, the bureau said.

Both companies will also modify their marketing practices. Among the changes, they will obtain customers’ consent to enroll them in services in which fees begin after free trials and make it easier for them to cancel services they do not want.