A holiday diving trip off the coast of Southern California turned into a nightmare early Monday when fire broke out aboard a boat just 20 yards from shore, killing up to 34 people trapped below deck, officials said.

As the 79-foot Conception’s captain and four colleagues jumped overboard off Santa Cruz Island near Santa Barbara, one other crew member and 33 passengers were sleeping below and had no way to escape, authorities said.

“Is the vessel fully engulfed now?’’ a US Coast Guard worker asked the captain, Jerry Boylan, in a distress call over the area’s emergency radio channel at 3:14 a.m.

“Roger. And there’s no escape hatch for any of the people on board,’’ the captain replied.

The operator asked, “Are they locked inside the boat? . . . Can you get back on board and unlock the doors so they can get off? . . . You don’t have any firefighter gear at all, no fire extinguishers or anything?”

The captain’s response is unclear, but a Coast Guard official later said the Conception was in “full compliance’’ with safety regulations.

The Coast Guard said late Monday night that a total of 25 bodies had been located.

Authorities had recovered 20 and discovered five, but those five could not be reached due to safety reasons. Nine people were still missing.

The boat was about 63 feet beneath the water’s surface.

Earlier on Monday, four of the bodies — two men and two women — were recovered in the water.

Those victims could not be identified due to the “conditions of the bodies,” authorities said, adding that DNA tests would have to be conducted.

It appeared those victims had drowned, officials said.

As the tragedy unfolded, video showed flames engulfing the boat against the dark predawn sky. By the time authorities were alerted, it appeared to be too late.

“The only mayday call we received was the vessel was engulfed in flames,’’ Coast Guard Capt. Monica Rochester told reporters.

As for the surviving crew members, “They jumped off’’ the burning boat and were rescued by a “good Samaritan vessel” called the Grape Escape, she said.

That boat is owned by Bob and Shirley Hansen. Shirley Hansen, told the LA Times that they awoke to loud thumping on their vessel and witnessed the distraught crew, including the captain, outside on a dingy.

“It was horrific, the pounding,” she said. “Our boat is very well made. Having that sound come through [showed] they were very in need of help.”

She said that one of the crew members had gone back to see if anyone had jumped overboard but the boat was completely engulfed in flames.

“As it was burning, there would be explosions going off every couple of minutes,” she said. “It was probably some of the dive tanks exploding. It made me feel so helpless.”

The Hansens said they gave the men — who were shivering and one wearing just underwear — blankets and clothes.

One of the men was crying and said that his girlfriend was still on the vessel below the deck.

The Hansens also said that the crew told them that three of their passengers had celebrated their birthdays only hours earlier — including a 17-year-old girl who was on board with her parents

Meanwhile, audio posted online of another distress call included a man screaming, “Mayday! Mayday! Mayday!” before saying, “I can’t breathe!”

When firefighting crews arrived, they had difficulty containing the blaze, which continued to break out in different places for hours, possibly because of the fuel aboard the Conception, 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,” US Coast Guard Senior Chief Aaron Bemis told CNN.

The boat, which slept a maximum of 46 people, was popular with customers seeking overnight diving and fishing excursions. It was based in Santa Barbara Harbor about 25 miles away.

Passengers paid $665 apiece, plus $95 daily for “a full set of rental gear,’’ for the three-day trip, which was run by Worldwide Diving Adventures, according to the website of Truth Aquatics, the owner of the boat.

The excursion began Friday evening and was supposed to wrap up at 5 p.m. Monday.

A man answering the phone at Truth Aquatics said the company had no comment. The phone for Worldwide Diving wasn’t working Monday.

Truth Aquatics’ website said Boylan, the son of a Coast Guard officer, has been with the company since 1983.

A photo showed him bedraggled and being taken to a Coast Guard station by boat. He was unable to be reached for comment.

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

The most serious injury suffered by any of the survivors was a broken leg, officials said.