A Lockheed C-130 transport plane made an emergency landing, crashed and caught fire at the Santa Barbara Airport in Southern California late Sunday night, but the seven people on board escaped unhurt, authorities said. The cause of the crash was being investigated.

Emergency crews sprayed the plane with foam to douse the flames.

The Federal Aviation Administration told CBS News the plane experienced hydraulic problems shortly after departing from the Santa Maria, California airport for Phoenix-Mesa Gateway Airport.

Get Breaking News Delivered to Your Inbox

The crew declared an emergency and diverted to Santa Barbara.

The aircraft landed at Santa Barbara around 10:30 p.m., then skidded off the runway and onto the infield.

Santa Barbara County Fire Department spokesperson Mike Eliason told how it all unfolded on Twitter:

#AircraftEmergency- A Private C-130 aircraft made an emergency landing, crashed and caught fire at the Santa Barbara Airport at 10:13 p.m. Sunday. 7 souls aboard/escaped w no injuries. **ALL MEDIA CALL SBAirport PIO At 805-319-1400** pic.twitter.com/JkQnFWMGmo — SBCFireInfo (@EliasonMike) August 26, 2019

#AircraftEmergency- A Private C-130 aircraft made an emergency landing, crashed and caught fire at the Santa Barbara Airport at 10:13 p.m. Sunday. 7 souls aboard/escaped w no injuries. **ALL MEDIA CALL SBAirport PIO At 805-319-1400** pic.twitter.com/ptJJbeUM2q — SBCFireInfo (@EliasonMike) August 26, 2019

The FAA said the National Transportation Safety Board will lead the probe into the cause of the crash, and the FAA will assist.

A Mesa, Arizona company called International Air Response is listed at the plane's owner. Its website says it is "a global provider of specialized aerial services" that "owns, maintains, and operates a large fleet of Lockheed C-130 Hercules aircraft" providing "safe, efficient, and effective emergency and non-emergency aerial services to a wide variety of government and private sector clients around the world."