Drivers were stuck in 109-degree heat on a California highway for hours on Saturday as the authorities struggled to extinguish a fire involving an overturned truck carrying lithium ion batteries.

The authorities responded early Friday after the truck crashed and caught fire near Baker, Calif., in the northbound lanes of I-15, a major highway that leads travelers to Las Vegas. Both northbound and southbound lanes were later closed.

The southbound lanes reopened shortly after 2:30 p.m. on Friday, according to the California Highway Patrol. But the northbound lanes were still closed as of early Sunday morning, according to the California Department of Transportation.

The California Highway Patrol said it had cleared the backlog of stuck vehicles on the closed highway by rerouting them to nearby I-40, which the agency described as “the only alternative” because of the location of the closure on I-15. But that caused heavy traffic on I-40.

The California Department of Transportation said on social media late Saturday that it was providing water and assistance to stranded vehicles on both highways. But it was still working with other agencies to “expedite the removal of the overturned semi.”

The San Bernardino County Fire Protection District said that multiple attempts had been made to move the container off the highway shoulder with heavy machinery. “However, the container’s weight, exceeding 75,000 pounds, has made these efforts unsuccessful so far,” it said.