Château d ' If The Château d ' If is a fortress ( later a prison ) located on the island of If , the smallest island in the Frioul Archipelago situated in the Mediterranean Sea about a mile offshore in the Bay of Marseille in southeastern France . It is famous for being one of the settings of Alexandre Dumas ' adventure novel " The Count of Monte Cristo " . Island . Île d ’ If measures and is located 3 . 5 kilometers west of the Vieux Port in Marseille . The entire island is heavily fortified ; high ramparts with gun platforms surmount the cliffs that rise steeply from the surrounding ocean . Apart from the fortress , the island is uninhabited . Fortress . The " château " is a square , three - story building 28 m long on each side , flanked by three towers with large gun embrasure s . It was built in 1524 - 31 on the orders of King Francis I , who , during a visit in 1516 , saw the island as a strategically important location for defending the coastline from sea - based attacks . However , its construction was extremely controversial . When Marseille was annexed to France in 1481 , it retained the right to provide for its own defence . The castle was therefore seen by many of the local inhabitants as an unwanted imposition of central authority . The castle ' s principal military value was as a deterrent ; it never had to fight off an actual attack . The closest that it came to a genuine test of strength was in July 1531 , when the Holy Roman Emperor Charles V made preparations to attack Marseille . However , he abandoned the invasion plan , perhaps deterred by the presence of the castle . This was perhaps fortunate , given the weaknesses identified by the military engineer Vauban in a scathing report in 1701 : " The fortifications look like the rock , they are fully rendered , but very roughly and carelessly , with many imperfections . The whole having been very badly built and with little care . . . All the buildings , very crudely done , are ill made . " After his assassination in Cairo in 1800 , the embalmed body of general Jean Baptiste Kléber was repatriated to France . Napoleon , fearing his tomb would become a symbol to Republicanism , ordered it to stay at the château . It remained there for 18 years until Louis XVIII granted a proper burial in his native Strasbourg . Prison . The isolated location and dangerous offshore currents of the Château d ' If made it an ideal escape - proof prison , very much like the island of Alcatraz in California was in more modern times . Its use as a dumping ground for political and religious detainees soon made it one of the most feared and notorious jails in France . Over 3 , 500 Huguenots ( French Protestants ) were sent to Château d ' If , as was Gaston Crémieux , a leader of the Paris Commune , who was shot there in 1871 . The island became internationally famous in the 19th century when Alexandre Dumas used it as a setting for " The Count of Monte Cristo " , published to widespread acclaim in 1844 . In the book , the main character Edmond Dantès ( a commoner who later purchases the noble title of Count ) and his mentor , Abbé Faria , were both imprisoned in it . After fourteen years , Dantès makes a daring escape from the castle , becoming the first person ever to do so and survive . In reality , no one is known to have done this . The modern Château d ' If maintains adjacent cells named after Dantès and Faria as a tourist attraction . As was common practice in those days , prisoners were treated differently according to their class and wealth . The poorest were literally placed at the bottom , being confined to a windowless dungeon under the castle . The wealthiest were much better off , living comparatively comfortably in their own private cells ( or " pistoles " ) higher up , with windows , a garderobe and a fireplace . However , they were expected to pay for this privilege , effectively forcing them to fund their own incarceration . The château today . The château ' s use as a prison ceased at the end of the 19th century . It was demilitarized and opened to the public on September 23 , 1890 . It can now be reached by boat from Marseille ' s old port . Its fame as the setting for Dumas ' novel has made it a popular tourist destination . Mark Twain visited the château in July , 1867 during a months long pleasure excursion . He recounts his visit in his book , " The Innocents Abroad " . He says a guide took his party into the prison , which was not yet open to the public , and inside the cells , one of which he says housed the " Iron Mask . " This was prior to the château opening to the public . There is a sign at the château that says " Prison dite de l ' Homme au Masque de Fer " ( The prison known as the man in the iron mask ) , but this is likely only legend since the famed Man in the Iron Mask was never held at the Chateau d ' If . The Château d ' If is listed as a " monument historique " by the French Ministry of Culture . In fictional works . The fortress was used as the location where Alain Charnier a . k . a . Frog One ( Fernando Rey ) meets Devereaux ( Frédéric de Pasquale ) to finalise the drugs shipment to the United States in the 1971 crime film " The French Connection " . However , other locations have been used for Château d ' If in the retelling of Dumas ' " The Count of Monte Cristo " . In the 2002 adaptation starring Jim Caviezel , the château was represented by St . Mary ' s Tower on Comino , the smallest inhabited Maltese island . The cliff - top watchtower can be seen from the ferry crossing between Malta and Gozo . Contrary to common belief , the Marquis de Sade was not a not prisoner at the château .