A 13-year-old boy was critically injured and flown to a hospital by helicopter after being attacked Saturday by a shark off the coast of Encinitas, California, officials said.

The boy, who was not identified, suffered "traumatic injuries to the upper torso area” in the early morning attack near Beacon's Beach, said Encinitas Lifeguard Capt. Larry Giles.

Officials with Rady Children's Hospital said Sunday the boy was expected to recover after undergoing surgery.

After the attack, the boy was brought back to the beach by three good Samaritans on a kayak. About 30 people had been in the water diving for lobsters on the first day of the season, Giles and a witness said.

The 13-year old boy who was apparently bitten by a shark while free-diving on the first day of lobster season, on Sept. 29. 2018 in Encinitas, California. Family photo / via Rady Children's Hospital-San Diego

Lifeguards on scene provided life support before the boy was taken to a trauma center, Giles said. The boy was conscious when he was saved by bystanders and when he was transported by helicopter, he said.

"There was about 30 people in the water, and then we heard this kid scream—and I thought he just, you know, maybe his first bug [lobster], got like a big one and so I was happy for him,” Chad Hammel, one of the kayakers who helped rescue the boy, said.

"And then I kind of heard that 'I got bit,'" Hammel said. "There was a seal swimming around us, and so I kind of put two and two together. When I started paddling towards him and there was a big old, you know, wake of blood behind him."

Once on the kayak, Hammel said the boy’s “entire back was open.” The boy said the shark attacked him from the clavicle and on his back, and the shark's teeth cut part of his cheek.

One of the three men was swimming with his fins and Hammel paddled towards shore, but “the shark followed," Hammel said.

"He wasn't really chasing, but he was kind of waiting to see what was going to happen," he said. It was the boy’s first time out for lobster, Hammel said.

Bystanders said the shark was around 11 feet long, Giles said. The boy was in about 9 feet of water 150 to 200 yards from the beach. One of his parents was on the beach at the time.

"We are concerned about obviously public safety. The beaches are going to be closed down right now," Giles said. "We are asking people not to go into the water."

Bystanders reported there was a seal in the area at the time of the attack, Giles said. Seals are prey for some types of sharks, including great whites. Hammel said "it looked like a white." Officials were working with a marine scientist to determine the type of shark involved.

The boy’s family is requesting privacy but said they appreciate the support they have received, Dr. Tim Fairbanks, division chief of pediatric surgery and trauma surgery at Rady Children’s Hospital-San Diego, said in a statement on their behalf.

"The family is completely focused on their child at this time," Fairbanks said.

He added that the boy was free diving for lobsters when he was attacked.

The waters by beaches were closed from La Costa Avenue around South Ponto Beach south to Swami’s Beach and would remain closed for 48 hours to see if there was any more shark activity in the area, Giles said.

"At this time since the incident, we have not seen any shark activity at all," he said.

A surfing competition down the beach was canceled Saturday, and a sheriff's helicopter was being flown to observe any signs of sharks, among other measures. If there is no more activity spotted, the beach closures could end at 7 a.m. Monday, Giles said.

"We don't want anybody else getting injured, so that's why we're taking the precautions that we're doing," Giles said.

After clearing the ocean area of surfers and swimmers, lifeguards watch over the waters, off Beacon's Beach, after authorities said a young boy was attacked by a shark in Encinitas, California, Sept. 29, 2018. Mike Blake / Reuters

One of the three kayakers who helped rescue the boy was an off-duty police officer from the city of Oceanside, another was an off-duty California state park lifeguard and the third was a friend of theirs, Giles said.

There have been a few shark attacks in the area recently, including a non-fatal attack near Camp Pendleton earlier this year and a fatal attack near Solana Beach several years ago, Giles said. In 2008, a swimmer was killed by a great white shark off Solana Beach, according to reports at the time.

The attack shocked some people familiar with the waters off Beacon’s Beach. Mike McInnis, who lives nearby, learned to surf there when he was 6 years old.

"I just couldn’t believe it was happening, in my surf break," McInnis said. "I surf here almost every day."

There were a series of possible shark sightings reported off the coast of Oceanside, a city north of Encinitas, in late June, The San Diego Union-Tribune reported.

Earlier this month, a swimmer was killed in a shark attack off Cape Cod in Massachusetts. The Sept. 15 attack that killed a 26-year-old man was the first fatal shark attack in that state since 1936, and the first deadly attack in the U.S. since 2015, officials said.

Encinitas is a coastal city of around 60,000 people north of San Diego.