A cruise ship that left New Jersey on Thursday afternoon headed back to shore hours later after an 8-year-old boy nearly drowned in one of the ship's pools.

The boy and his family were sailing on Royal Caribbean's "Anthem of the Seas" when he had an accident in a ship pool, the cruise liner said in a statement.

The ship sailed back to Bayonne Thursday night to get the 8-year-old medical attention. He is being treated at a local hospital.

"Our Care Team is providing support to his family," Royal Caribbean officials said. "Please join us in keeping them in our thoughts and prayers."

The boy was on life-support, according to WABC, although WNBC reported the boy's condition was unknown. Officials told WCBS he was deprived of oxygen for 18 minutes.

The ship was between five and 10 miles off the shore of Breezy Point, Queens, when the child was discovered, according to WCBS.

Authorities told WABC the boy is from the Netherlands and was part of a group of 49 travelers.

Officials with the U.S. Coast Guard and the New York City police and fire departments met the ship. The boy was taken by helicopter to Staten Island University Hospital, WNBC reported.