Shakespeare wrote The Tempest in 1610, near the end of his career. It was performed first for King James I.
The Tempest is a play by William Shakespeare, believed to have been written in 1610–11, and thought by many critics to be the last play that Shakespeare wrote alone. It is set on a remote island, where Prospero, the rightful Duke of Milan, plots to restore his daughter Miranda to her rightful place using illusion and skilful manipulation. He conjures up a storm, the eponymous tempest, to lure his usurping brother Antonio and the complicit King Alonso of Naples to the island
From Wikipedia a summary of the story:
Magician Prospero, rightful Duke of Milan, and his daughter, Miranda, have been stranded for twelve years on an island after Prospero's jealous brother Antonio (aided by Alonso, the King of Naples) deposed him and set him adrift with the then-3-year-old Miranda.
Gonzalo, the King's counsellor, had secretly supplied their boat with plenty of food, water, clothes and the most-prized books from Prospero's library. Possessing magic powers due to his great learning, Prospero is reluctantly served by a spirit, Ariel, whom Prospero had rescued from a tree in which he had been trapped by the cruel witch, Sycorax, after he had refused to obey her. Prospero maintains Ariel's loyalty by repeatedly promising to release the "airy spirit" from servitude.
Caliban, a deformed monster and the only non-spiritual inhabitant before the arrival of Prospero, was initially adopted and raised by him. He taught Prospero how to survive on the island, while Prospero and Miranda taught Caliban religion and their own language. Following Caliban's attempted rape of Miranda, he had been compelled by Prospero to serve as the magician's slave. In slavery, Caliban has come to view Prospero as a usurper and has grown to resent him and his daughter. Prospero and Miranda in turn view Caliban with contempt and disgust.
In the conclusion, all the main characters are brought together before Prospero, who forgives Alonso. He also forgives Antonio and Sebastian, but warns them against further betrayal. Ariel is charged to prepare the proper sailing weather to guide Alonso and his entourage (including Prospero and Miranda) back to the Royal fleet and then to Naples, where Ferdinand and Miranda will be married. After discharging this task, Ariel will finally be free. Prospero pardons Caliban, who is sent to prepare Prospero's cell, to which Alonso and his party are invited for a final night before their departure. (It is however not made clear whether, after their departure, Caliban will remain on the island or whether he will be taken to Naples). Prospero indicates that he intends to entertain them with the story of his life on the island. Prospero has resolved to break and bury his magic staff, and "drown" his book of magic, and in his epilogue, shorn of his magic powers, he invites the audience to set him free from the island with their applause.