Shaquille "Shaq" O'Neal was temporarily trapped inside a 12-foot-tall enclosure with a shark after the curious creature wiggled its way through the metal bars during the filming of a television show.

Divers rushed to Shaq, star of Discovery Channel's "Shaq Does Shark Week" Sunday, and he was pulled from the water seconds later.

"I survived a shark attack, you b----es!" he shouted as he exited the shark cage.

The 7.1-foot former NBA star admitted to The New York Post last week that he's "terrified" of sharks — but that didn't stop him from diving into shark-infested waters in the Bahamas.

"Shark Week" fans took in the drama Sunday night as they watched the opening scene.

SHARK SHOCKER: 20-FOOT GREAT WHITE 'DEEP BLUE' CAUGHT ON CAMERA

"Give me my goggles. I'm going in. I ain't afraid of no shark," Shaq, 46, told his comedian co-star Rob Riggle as he entered the custom-built cage.

"You should be a little afraid, but that's OK," Riggle suggested. "You got this, Shaq. All day — all day."

Dramatic music played in the background as Shaq was submerged in the cage, surveying his surroundings. Divers reported Shaq looked "a little nervous" as sharks circled his cage. A handful of sharks swarmed near the boat as Riggle shot chum into the water.

"There's a shark getting in the cage! There's a shark in the cage!" a diver was suddenly overheard yelling over a microphone. "We've got to get him out."

Shaq remained calm as divers distracted the shark and crew members helped lift him out of the cage.

500-POUND GOLIATH GROUPER EATS SHARK AS SHOCKED FLORIDA FISHERMEN WATCH: 'HE JUST SUCKED IT IN'

Will Packer, an executive producer for the episode, said it was fortunate nobody got hurt during filming. He recalled Shaq's initial reaction to jumping into the open ocean.

“He was apprehensive at first, but once he saw the other divers and camera guys out in the water he said, ‘If those guys can do it, I’ll do it,’ and he went for it,” Packer told the New York Post. “He said, ‘Let’s get down there and see what happens.’”

The crew was shocked when the shark managed to break into the large cage with the frightened NBA star. According to the Post, that hasn't happened in 30 years — since "Shark Week" first aired in July 1988.

“The space between the [cage’s] bars was different than normal and the shark was able to wiggle into the cage,” Packer explained. “Shaq hasn’t moved that fast since he was in the NBA.”