William Shakespeare famously based a number of his history plays on real-life characters from the past, including the English Kings Richard III, Henry V, and Henry VI; legendary figures like King Lear and Cymbeline, an ancient king of Britain; and Roman generals and leaders, like Titus Andronicus, Coriolanus, and Julius Caesar. But of all his remaining plays —namely, the comedies and tragedies — at least one is believed to have at least some grounding in an actual historical event.

According to legend, Shakespeare’s The Tempest; generally taken to be the last play on which he worked prior to his death, was based on a contemporary true-life story of a shipwreck that had gripped England in the early 1600s. How much of the actual story Shakespeare chose to use in his play is, however, open to debate, especially given that his play takes place on an enchanted island overseen by a powerful sorcerer and his circle of supernatural assistants!

In the play, Prospero, the rightful heir to the dukedom of Milan, has been stranded on the unnamed island for more than a decade, having been double-crossed and set adrift at sea with his daughter Miranda by his brother Antonio, who has usurped his throne back in Milan. Having washed up on the shore of the island, Prospero uses his knowledge of magic and the supernatural to summon a band of spirits; including the fleet-footed Ariel and the monstrous Caliban, to help him and his daughter survive. When a storm wrecks another ship from Milan on the island’s reefs, Prospero uses his magic to both keep the vessel safe in its harbor and divide its motley crew into groups, all as part of a grand plan to reclaim his throne and take back control of Milan.

Prospero’s magical powers and his merry band of sprites and spirits aren’t, of course, rooted in any real-life sorcery. But the shipwreck that crashes upon his island almost certainly was.

On June 2, 1609, a ship named the Sea Venture set sail from Portsmouth, on the south coast of England, as part of a vast fleet of ships heading for Jamestown in Virginia. After nearly two months at sea, on July 24 the fleet sailed directly into an enormous tropical storm, and while the majority of its ships headed northwards to escape the hurricane, the Sea Venture became separated from the group. Lost at sea, she and her crew were left to face the full force of the storm alone.

The ship’s captain, Sir George Somers, was left with only one option. He intentionally steered the ship towards the only solid land that he and his 150 passengers and fellow crew members had seen for weeks and deliberately ran the Sea Venture aground on what is now Bermuda. For the next nine months, the survivors of the Sea Venture were left stranded on the island, with no means of letting the outside world know that, thanks to Captain Somers’ actions, they had indeed survived the storm.

During those nine months, Somers and his surviving crewmen used the wreckage of the Sea Venture (along with some timber sourced from the island itself) to construct two smaller vessels, which they named the Deliverance and Patience. Eventually, they were deemed seaworthy, and the survivors of the Sea Venture set sail once more; and finally reached Jamestown on May 23, 1610—almost a year after they had first left England.

On their arrival in America, news of the incredible ordeal and survival of the Sea Venture and her passengers caused a sensation, and as a result, soon reached England. In 1610, an English writer named William Strachey, who had been one of the passengers on the Sea Venture, published what he called his True Repertory, a 24,000-word account of the “wracke and redemption” of the ship, and its eventual miraculous arrival in Jamestown. Believing that Shakespeare likely began work on the script for The Tempest sometime in late 1610-early 1611, many Shakespearean scholars now believe that it’s likely Strachey’s account (or, at least, an account very similar to it) may indeed have provided him with the inspiration he needed for the last of his astonishing plays.

Whether it did or did not, however, remains debatable—but there is, at least, one more thing that is most definitely inspired by the Sea Venture’s remarkable tale of survival: to this day, the flag of Bermuda depicts a ship being wrecked upon the island’s shores.