Thousands of people have been evacuated, including more than 200 female inmates at a prison.
Firefighters were having difficulty combating the blaze because of the topography of the city, which is surrounded by dozens of steep hills where most people live.
"This is the worst disaster I have seen," regional governor Ricardo Bravo said. "Now we fear that the fire will spread to the centre of the city, which would increase the severity of the emergency."
Interior Minister Rodrigo Penailillo said the fire has caused the deaths of four people -- three men and a woman. Thick clouds of smoke surrounded the city's prison and nine pregnant inmates were transferred to a detention facility in the nearby city of Quillota.
More From This Section
Prison authorities were evacuating another 204 female inmates to a sports arena. The more than 2,700 male inmates will remain at the prison for the time being, prison guard commander Tulio Arce said.
While firefighters, police and forest rangers battled the blaze, Chilean marines in combat gear patrolled streets in the city to maintain order and prevent looting.
The fire started yesterday afternoon in hills on the edge of the city and spread rapidly because of strong winds. Hot ash rained down on the city early today, causing respiratory problems among the population, especially children and the elderly.