At least 14 people have been injured, four of them seriously, after a commuter train traveling from Silicon Valley to Stockton derailed and two of its cars crashed into a local creek in California.

The incident took place in a rural area some 72km east of San Francisco on Monday night, Altamont Corridor Express (ACE) train officials told KCBS radio, adding that there were at least 214 passengers on the train at the time of the incident.

At least four of the 14 people hurt in the incident received “serious” but “non-life-threatening” injuries, the Alameda Fire Department said. Officials added that it was raining heavily at the time of the incident.

“It was dark, wet, it was raining. It was very chaotic,” Alameda County Sheriff’s Sgt. Ray Kelly said, as cited by AP. “This is an absolute miracle that no one was killed, no passengers or first responders.”

According to Alameda County Sheriff’s Department spokesman J.D. Nelson, one of the train cars has been partially submerged in the creek.

The first car that fell into Alameda creek was carrying six passengers and one crew member, Altamont Corridor Express train official Steve Walker said.

Later all passengers were rescued and the injured were transported to the Alameda County Fair in Pleasanton.