A Burlington Northern Railroad train derailed into the Kootenai River Wednesday night, prompting a rescue mission for three crew members on board.

The Boundary County Sheriff’s Office received a call about the derailment around 9:00 p.m. The caller reported the front engine of the train was in the river and several crew members had been trapped inside.

According to the Kootenai Valley Times, the crew from Spokane crawled out of the front engine and sat on top of it while awaiting rescuers. The remaining 113 cars, seven of which contained hazardous materials, stayed upright, the article said.

Numerous local agencies sent crews to the scene, including the Boundary County Sheriff’s Office, Boundary County Search and Rescue, Boundary County Emergency Management, Boundary Ambulance, multiple fire agencies and Idaho State Police.

Crews could only get to the scene through the water, according to the Boundary County Sheriff’s Office. Deputies eventually rescued the stranded crew members via boat. They were taken to the hospital.

“Two locomotives under water, passengers probably waist-deep,” said Rob Cherot, one of the rescue pilots called to the scene.

It took them about 35 minutes to get there, he said, flying through heavy fog and snowy conditions.

“But once we got onto the location we had good visibility above the wreckage except for the river, which was socked in with fog on one-half of the river, which was the side the train was on,” said Cherot.

BNSF confirmed to 4 News Now that the derailment involved a manifest train carrying several types of cargo. The train was traveling from Minnesota to Pasco.

An initial report indicated a rock slide caused the three locomotives and one car to leave the tracks. A reliable source said there should have been a fence there to warn crew members of rocks sitting on the tracks.

According to that source, the fence was removed several years ago during work on the hillside and was never put back into place.

One locomotive went into the water and has leaked an unknown amount of fuel into the river. Containment booms were placed in the river to catch the fuel.

Had that rock slide happened just two hours later, sources say it could have been an Amtrak train going from Chicago to Seattle that derailed.

On Thursday afternoon, the Boundary County Commissioners issued a state of local emergency in order to restrict boat access in the area as crews continue to remove the train. Restrictions should stay in place through the week.

RELATED: Train derailment forces Boundary County to issue emergency ordinance restricting access to boat launch