A three-day holiday diving trip off the coast of California turned into unimaginable horror when fire broke out aboard ship early Monday, killing up to 34 passengers who were trapped below deck, authorities said.

The 79-foot tour boat had been carrying five crew members and the more than three dozen passengers — all of whom were sleeping — when the flames erupted around 3:15 a.m. local time off Santa Cruz Island.

All of the crew were awake and on the bridge when the blaze broke out, said US Coast Guard Capt. Monica Rochester at a press conference.

“They jumped off’’ the burning boat and were rescued by a good Samaritan vessel that was nearby called the Grape Escape, Rochester said.

As for the passengers, “currently, 34 people aboard the vessel are unaccounted for,’’ she said.

“They were below deck asleep.’’

US Coast Guard Senior Chief Aaron Bemis told CNN, “The report that we got was they were trapped by the fire.’’

Asked if the crew tried to help the passengers before fleeing, Rochester replied, “I don’t have any information on that.’’

Santa Barbara Fire Department spokesman Mike Eliason, whose agency is helping in the disaster, told CNN, “We’re still holding hope that someone may have swam to shore.

“When they anchor overnight, they’re pretty close to shore,’’ he said. “We have to hope, but we plan for worst-case scenario.”

Four of the crew were already en route to shore by mid-morning, while the boat’s captain remained at the scene, CNN said, quoting a US Coast Guard official.

Video showed fire engulfing the boat against a dark night sky.

By the time authorities were alerted to the disaster, it appeared to be too late.

“The only mayday call we received was the vessel was engulfed in flames,’’ Rochester said.

Once firefighting crews arrived, they had difficulty containing the flames, which continued to break out in different places for hours, possibly because of the fuel on the boat, officials said.

“The fire was so intense, even after it was put out, we were not able to embark on the vessel and look for survivors,” Bemis said.

The ravaged craft, named Conception — and dubbed The Warrior by its operator, True Aquatics — eventually sank in 65 feet of water about 20 yards from shore, the Coast Guard said.

The boat was popular with customers seeking overnight diving and fishing excursions in the lush Southern California waters. It was based in Santa Barbara Harbor.