Medical officials confirmed Monday that an 8-year-old boy found nearly drowned on a Royal Caribbean cruise ship off the coast of New Jersey last month has died.

The boy, identified by the Staten Island Advance as Prince Adepoju of Maryland, died July 2 after he was found two days earlier in a pool on Royal Caribbean's "Anthem of the Seas."

A spokeswoman for the Office of the Chief Medical Examiner told the Staten Island Advance that the death was ruled an accidental drowning.

"We are heartbroken to learn the news of his passing," Royal Caribbean officials said in a statement released to the Advance. "Our thoughts and prayers are with the family at this terribly sad time."

"Anthem of the Seas" turned back to shore not long after leaving Bayonne, New Jersey, on June 30. The ship was between five and 10 miles off the shore of Breezy Point, Queens, when Prince was found unresponsive.

Officials told WCBS that the 8-year-old was deprived of oxygen for 18 minutes.

The U.S. Coast Guard and New York City police and fire departments met the ship after it turned back. The boy was taken by helicopter to Staten Island University Hospital.