WASHINGTON — The Justice Department has nearly completed a highly critical report accusing the police in Ferguson, Mo., of making discriminatory traffic stops of African-Americans that created years of racial animosity leading up to an officer’s shooting of a black teenager last summer, law enforcement officials said.

According to several officials who have been briefed on the report’s conclusions, the report criticizes the city for disproportionately ticketing and arresting African-Americans and relying on the fines to balance the city’s budget. The report, which is expected to be released as early as this week, will force Ferguson officials to either negotiate a settlement with the Justice Department or face being sued by it on civil rights charges. Either way, the result is likely to be significant changes inside the Ferguson Police Department, which is at the center of a national debate over race and policing.

Ferguson erupted into angry, sometimes violent protests after a white police officer, Darren Wilson, shot and killed an unarmed black teenager, Michael Brown, in August. The Justice Department investigated that shooting, and officials have said they will clear the officer of civil rights charges. That finding is also expected soon.

But the report into the broader practices of the local police department will give the context for the shooting, describing the mounting sense of frustration and anger in a predominantly black city where the police department and local government are mostly white.