The three-alarm fire sent thick black plumes of smoke into the air, causing traffic delays on both sides of the 215 Freeway near Nuevo Road.
Firefighters say there were at least three spot fires burning near the building in the 24000 block of Orange Avenue.
At least 10 engines and 130 firefighters from county and state agencies responded to the blaze.
There were no immediate reports of injuries.
The fire was first reported at 3:35 p.m. and was considered fully contained by 9 p.m.
Damage to the building was estimated at $3.5 million.
The cause of the fire was under investigation. There were no reports of injuries.
The Salvation Army identified the building as its Riverside Adult Rehabilitation Center. The facility provides treatment for men who have drug or alcohol problems.
The fire began in the warehouse section and spread to the annex building. The Salvation Army is making a summer camp facility in the San Gabriel Mountains available for displaced residents.
Outside the building, there appeared to be piles of personal items, including clothes and furniture, that had been rescued before the flames consumed the structure.