Southbound lanes of the Interstate 15 were closed at Joshua Street/395.
Northbound lanes were closed at Ranchero Road.
Caliente Road was closed from Joshua Street to Oak Hill Road.
Part of the bridge collapsed shortly before 4 p.m. Another portion of the bridge collapsed at about 5:25 p.m.
Both directions of the I-15 in Hesperia were closed until further notice, according to Caltrans.
The California Highway Patrol said the I-15 will remain closed for at least 24 to 48 hours.
The bridge caught fire at about 1:30 p.m. Debris falling from the bridge onto freeway lanes initially forced lane closures.
At least one worker cutting rebar with a cutting torch ignited a wooden section of the bridge, according to the San Bernardino County Fire Department.
Winds were blowing up to 20 mph during the fire. More than 60 firefighters were assigned to the fire.
A contractor was treated for smoke inhalation at the scene and released, and was not hospitalized.
A Caltrans official said investigators will assess the condition of the I-15 lanes after the fire was out and debris had been cleared. There is concern the roadway has been damaged by falling steel and other debris.
Northbound I-15 drivers were advised to exit at the 138 in the Cajon Pass, then head northwest to Highway 18, then head east and exit onto side streets like Main or Phelan. Southbound drivers exit westbound on the 18, then southbound on the 138 to rejoin the I-15 below the incident.
The Interstate 15 Ranchero Road Interchange project is under construction to connect Mariposa Road and Caliente Road to I-15 with a full interchange, according to the San Bernardino Associated Governments (SANBAG). SANBAG is the council of governments and transportation planning agency for the county, according to its website.
A SANBAG official said the "falsework" of the bridge will have to be dismantled, but will be easily and quickly done since no concrete had yet been laid.