SPOKANE, Wash. — The city of Spokane, Washington, has agreed to change its policies to make clear that police officers will not question or detain people to enforce federal immigration laws.

That’s part of a final settlement the city reached Tuesday in federal court with the ACLU of Washington and the Northwest Immigrant Rights Project.

The case stems from a 2014 traffic accident when the vehicle of Gabriel Gomez was struck by a minivan that failed to yield the right of way.

A Spokane police officer responded and contacted the U.S. Border Patrol to ask whether the agency had any interest in Gomez.

The officer issued a ticket to the other driver and then let that driver leave the scene. However, the officer detained Gomez until the Border Patrol arrived and took him into custody.

“I have lived in this community for many years, and to suddenly have the police turn against me after being a victim in the accident really turned my life upside down,” Gomez said in a press release. “I want to be able to trust the police.”

The city said police were committed to enforcing the law “equally, fairly and without discrimination.”

“The department has begun updating its policies on immigration to ensure they are clear and consistent,” the city said in a prepared statement.

Spokane is Washington’s second-largest city with about 210,000 residents.

Gomez was eventually transferred by immigration officials to the Northwest Detention Center in Tacoma, where he remained until he posted bond. Gomez is seeking legal status to remain in this country, the ACLU said.

The lawsuit contended the officer unlawfully detained Gomez for purposes of investigating his immigration status and prolonged his detention to assist federal officers. The lawsuit also alleged that city policies unlawfully authorized officers to take such actions.

As part of the settlement, the city agreed to modify its policies to clarify that police officers “shall not contact, question, delay, detain or arrest an individual because s/he is suspected of violating immigration laws,” the settlement said.