Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

SPOKANE, Wash. — The city of Spokane 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.

Spokane police officers cordon off a house after a shooting in Spokane, Washington on Friday, Nov. 12, 2010. Christopher Anderson / AP file

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

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.

Related: ICE deportation arrests soar under Trump administration, drop in border arrests

"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."

City officials did not immediately return a message seeking comment.

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.

Related: Border arrests down, but other immigrant detentions up in Trump era

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.