Prince Rainier III of Monaco, who has died aged 81, was head of one of Europe's oldest ruling dynasties and its longest-reigning monarch. His tiny principality on the Côte d'Azur - circumscribed by the super-rich, the Mafia and France - was once described by Somerset Maugham as "a sunny place for shady people".
The prince believed in the divine right to rule and was Europe's last constitutional autocrat, leading Monaco away from dependence on gambling towards a tax-free future of skyscrapers, banking and business. Formula 1 Grand Prix racing on Monte Carlo's streets brought glamour.
In Ireland, a Prince Charming image was marked by his 1956 fairytale marriage to Grace Kelly, the Hollywood star and grand- daughter of a self-made Irish Philadelphia builder. At first, to the super-snobs of Monaco's 1950s community of old money, faded aristocrats and several thousand ethnic Monégasques, she was "an Irish bricklayer's daughter".
After her death in a still mysterious 1982 car crash, Rainier never remarried, saying in 1999: "I still feel her absence. It was a marriage of love."
When the couple visited Ireland for the first time in 1961 for the Dublin International Festival of Music and the Arts, it was the biggest welcome the State had ever given to a head of state and it was the first non-British royal state visit. It was as if Ireland had a princess of its own. The prince said that for them it was like "visiting old friends" - 75,000 of them on Dublin streets.
The royal couple were guests of President and Bean de Valera at Áras an Uachtaráin and all of Dublin's 300 "tails" for hire were snapped up. The 85-strong National State Orchestra of Monte Carlo came, too. The prince beat Lord Killanin, Monaco's consul-general, at golf. Later de Valera sent Connemara ponies for the Rainiers' children, Caroline and Albert.
Love of the woman who would provide an heir - she had to submit to a fertility test - was not at first sight, but grew on Rainier. Without a male heir the principality would revert to France, according to a 1918 treaty.
Grace brought Hollywood stars and new money to the pretty but peeling principality he had inherited in 1949. In 1956 it was the marriage of the century. (When the wedding was announced, her film, To Catch a Thief, was showing at the Ambassador cinema, Dublin. The year before she had won the best actress Oscar for The Country Girl.)
He gave up skin-diving and sports-car racing for her. But their story seems to be something of a forerunner of Charles and Diana, with an unhappy American trying to fit into life as a Latin royal divorced from the film-making she longed to retain as part of her life. Later there were stories of her unhappiness in her demanding new role. Prince Rainier was said to be jealous during visits by old Hollywood friends like Cary Grant and David Niven.
Princess Diana was the only member of the British royal family at Grace's funeral, a sign that the House of Rainier was not considered top drawer.
To Monaco-watchers, Grace's death seemed to signal the lasting force of the "Curse of the Grimaldis" (Rainier's family). In the 13th century, legend has it, Rainier I kidnapped and raped a beautiful Flemish maiden as part of the spoils of victory. She became a witch and cursed the family saying: "Never will a Grimaldi find true happiness in marriage."
Grace's passing, the colourful - often tragic - lifestyle of the Rainier children, above all the rebellious youngest, Stephanie, have left the discreet, heavily censored police state with a tattered reputation and still no obvious heir after Prince Albert (47), a playboy bachelor and "sporting prince". Until only last week, when Prince Rainier handed over powers to his childless son - but not the throne - the ruler had said constantly that Albert was "not ready".
According to a 2002 constitutional amendment, Caroline (48) is next in line after Albert. She would be succeeded by her son, Andrea Albert. It has been said that the prince's passing may be the end of the line for "Europe's tackiest royal family".
Prince Rainier's real legacy was to preserve his sales-tax-only haven as a family firm and to hand on a more viable principality which he astutely managed and protected against France, gold-digging lovers of his children and the paparazzi. But France and the OECD have been vocal about a dirty-money haven.
In the 1960s Aristotle Onassis wanted to buy Monte Carlo's famous casino and keep Monaco as an exclusive resort for the super-rich. The prince saw the future a little further down market. He reclaimed land from the sea, accommodated cruise ships and promoted light industry, new skyscrapers and international conventions. He also built an underground rail tunnel under the 2.5 sq km territory.
During a long stand-off with the de Gaulle government over taxing French shell companies in Monaco, he suspended parliament for three years until 1962 when he promulgated a new constitution (giving women the vote to a consultative assembly). "I am at the end of my patience," he had said in 1959 to demands to limit his absolute powers, banning all political meetings.
His Serene Highness Prince Rainier III Louis Henri Maxence Bertrand Grimaldi BA was born in 1923 to Princess Charlotte, who was in fact an illegitimate daughter of Prince Rainier's infamous grandfather, Louis, and Comte Pierre de Polignac. Pierre became a prince, adopting the old Genoese family name Grimaldi and by this bizarre sleight of hand the family could still rule.
It saw off a threat from a German branch of the Grimaldis.
The unhappy union ended in an 18- month custody battle over their son, which traumatised Rainier. He was educated at Stowe public school (which he hated) and in Geneva. He took a degree in arts at Montpellier University and studied political science in German-occupied Paris.
As ruler, his unpopular grandfather Prince Louis had collaborated with the Nazis and the Vichy government, but in 1944 Prince Rainier joined the Free French, serving in Alsace.
An intelligence colonel, Rainier was awarded the Croix de Guerre and later became a chevalier in the Légion d'Honneur. He returned to the almost bankrupt principality to be a daredevil playboy (with a passion for circuses).
But Rainier's war record helped stay the hand of Allied revenge for his grandfather's wartime behaviour. Monaco gained UN membership and last year joined the Council of Europe. Rainier's modernisation and endurance of family pain gained him the affection of his people.
Prince Rainier is survived by his children, Caroline, Albert and Stephanie, as well as seven grandchildren. His burial, beside Princess Grace, will be on April 15th.
Prince Rainier III: Born May 31st, 1923; died April 6th, 2005