WASHINGTON — Officials in Ferguson, Mo., have reached the outlines of a deal with the Justice Department that would force changes to the city’s Police Department and head off a civil rights lawsuit alleging years of unconstitutional policing, local and federal officials said.

Completing the deal, however, will require support from diverse factions of Ferguson’s leadership, which will have to sell residents on the idea of a federal policing monitor and of huge new expenses for a city that is already struggling financially. Some officials said a local tax increase appears unavoidable, which in Missouri requires approval from voters.

The agreement, which would be filed in federal court, would require new training for police officers and improved record-keeping, and would install a federal monitor to ensure those changes were made, officials said.

The two sides have been negotiating for several months, after a scathing Justice Department report in March described Ferguson as a city where police officers often stop and arrest people without cause, where the court operates as a moneymaking venture, and where officers used excessive force almost exclusively against blacks.