OLYMPIA, Wash. - The Washington Attorney General's Office says ride-hailing service Uber has agreed to pay $40,000 and to stop sending unsolicited text messages to customers in the state.

Attorney General Bob Ferguson says hundreds and perhaps thousands of people in the state received texts and didn't know how to stop them. Some of the messages were intended for Uber drivers but were sent to customers who didn't sign up to be drivers.

Ferguson says the company didn't provide a way to opt out of receiving the texts, as required by law. He says Uber cooperated and started making changes after his office began investigating in 2014.

The $40,000 covers costs associated with the investigation.

Uber spokesman Nathan Hambley says the company is pleased to have resolved the matter.