When Tolstoy famously noted that all happy families resemble one another, but each unhappy family is unhappy in its own way, he might have been writing about the Hamiltons, one of Scotland's proudest and most aristocratic families. King Lear, or War and Peace, has nothing on this

family, which has long been riven by deeply-felt wounds and acrimonious differences.

Put this to the best-selling novelist Julia Hamilton and she sighs heavily, then wholeheartedly agrees with you. Small wonder, she murmurs, that she became a writer. Few other authors could have had such a rich motherlode of material on which to draw.

When it comes to skeletons in cupboards, the Hamilton family has something of a monopoly. Which is, of course, why the 45-year-old daughter of the thirteenth Earl of Belhaven and Stenton has made a successful career out of telling delightfully scandalous family sagas. The author of six intelligently written, cleverly plotted page-turners, Hamilton is about to publish her latest, the compelling Forbidden Fruits. The book is set in Edinburgh's Georgian New Town among the decadent classes, and in Galloway, where she spent her childhood as ''the product of an old-fashioned, upper-class Edwardian upbringing''.

The tale of a family destroyed by secrets, lies and shocking behaviour, Forbidden Fruits has already been optioned by the BBC, while her

fifth novel, the psychological thriller Other

People's Rules, has been bought by Granada. Hamilton has also just won a lucrative contract that will see her books released in the States, which means her publisher, HarperCollins, will almost certainly re-print her four earlier books. The company is promoting her heavily as ''a major female author in the Rosamund Pilcher and Penny Vincenzi tradition'', and predicting she will soon be in their squillion-selling league.

An accomplished storyteller, Hamilton is, of course, in the business of writing fiction, but when we meet for afternoon tea in one of Edinburgh's swankier hotels, she concedes that in her case, art really does mirror life. Slightly breathless and apologising for being all of three minutes late, she has just arrived in the city from Gatehouse, where she is staying with her mother for a few days. We order a pot of Earl Grey and she wriggles with pleasure at the prospect of such a mid-afternoon treat. Usually, she declares, she would be sitting at her desk - the dining room table in her London home, busily writing.

Crumbling a piece of shortbread which, to Hamilton's delight, has come complete with a sprig of heather, she launches into the story of her third wedding, which took place in Oxford a year ago. Perhaps it is the way she tells it, but her description of the event sounds exactly like a scene from one of her books. The wedding feast was a happy occasion for the twice-divorced Hamilton and her new husband, the writer and journalist Trevor Mostyn, but the sulphurous whiff of the Hamilton family must have hung in the air throughout the ceremony. ''None of us is on speakers,'' admits Hamilton.

Her father, who refused to come to the wedding, and her Australian-born mother, Ann Belhaven, divorced bitterly when Hamilton was just 13 and have not spoken for years. The author and her father, the 75-year-old Robert Anthony Carmichael Hamilton, do not speak to each

other because of something she wrote about him in a magazine. ''Anyway, he's a serial re-marrier, so I was perfectly happy to shop him,'' she

confides. ''I am, though, very, very fond of my mother and love her dearly, because she has always been so very supportive of me, and I'm anxious to protect her.''

Ann Belhaven lives in Scotland, although

she regularly visits her daughter at the book-lined flat in Notting Hill she now shares with Mostyn. Lord Belhaven and his 47-year-old son, Freddie - Hamilton's brother, who is now Master of

Belhaven and heir to the title - are on speaking terms, but do not communicate. Freddie, who has been married twice, does not speak to his mother and Hamilton says she has forgotten why. ''We are just that sort of family, always at each other's throats and always rowing.''

It seems, then, that the Benenden-schooled novelist (''I was sent there because it's where Princess Anne was educated'') has lived through a sorry, convoluted family saga that makes

even Jilly Cooper's more far-fetched creations sound plausible. The fact that Hamilton's rich life experience spills into her books is undoubtedly what makes them such good reads. Forbidden Fruits and Other People's Rules are both set in a world of extreme privilege and bad behaviour, where aristocrats all seem to have something nasty lurking in the gazebos of their ancestral homes.

All of which sounds depressingly familiar. ''Sadly, it's a world I know only too well,'' says Hamilton, sipping her tea and relishing the

fact that she's back in Edinburgh. She first

visited the capital as a child when her brother was boarding there at a Dickensian prep school. A handsome, strong-featured woman with beautiful amber eyes, a transforming smile and a potent feminine charm, she goes on to describe a miserable childhood spent in poverty on a badly-managed farm in Kirkcudbrightshire. Hamilton felt like an utter misfit. Her status as the member of an ancient family whose titles date back to 1647 was of no consequence - her grandfather had allowed the family estates at Wishaw in Lanarkshire, which the Hamiltons had farmed for three centuries, to run to seed. Eventually, her father moved the family to a hill farm with no electricity.

The two Hamilton children grew up in an atmosphere of bitter regret for the past,

compounded by an acute shortage of cash. ''We had this feeling that we had been cast out of Eden,'' says the writer. ''Like all good upper-class boys my brother was sent away to prep school and then Eton, while I stayed at home. I am sure that is why I became a writer because I knew so much about the dreadful things going on in my parents' marriage, which was desperately unhappy. I was almost unbearably sensitive to every nuance, always wondering what the emotional temperature was going to be. Growing up was no fun at all for me.''

Everything was disintegrating around her. ''The whole break-up of the estate had been badly managed,'' she says. ''Things were given away, other things were stolen or sold. The

family was riven by disputes and feuds and all that fell into our laps when Freddie and I were growing up. Everything had gone, the houses and the glory days, and we were left among

the remnants of this great house - all these huge pictures, even huger pieces of furniture and some beautiful books, which I read voraciously to take cover from my parents' unhappiness. Dad was simply selling everything as he ran out of money. My mother adores beautiful things and wanted to preserve them, but he was incredibly cavalier about it all. I remember him selling this exquisite, antique silver bowl - the Monteith bowl - and it causing endless trouble between them.''

With the family silver being rapidly sold off and the atmosphere at home curdling with recrimination, Hamilton was sent to the village primary school, where her feelings of being an outcast intensified. During the day she spoke broad Scots, reverting to her own, cut-glass accent only at home. ''I had to, otherwise I'd have been lynched. It was bad enough the other children knowing my father was a lord. I was a really pugnacious little girl because I had lots

of practice fighting my brother, who teased

me endlessly, so I got into terrible physical fights at school.''

After a term at Kirkcudbright Academy, she was sent to Benenden. For years, her daughters - who are now 18 and 21 - thought their mother had been educated by Benetton. ''When I got there, late of course, I really had to run to catch up,'' she says. Unfortunately, she failed to do that. She desperately wanted to go to Oxford, but flunked her exams. ''Surprise, surprise,'' she murmurs. ''I was in a world where I belonged socially, but I missed Scotland dreadfully, although I have a tortured relationship with it because my childhood was so painful. Sometimes I used to think I had invented Galloway, that it didn't really exist. I have always felt utterly haunted by Scotland.''

Once her parents had split up, Lord Belhaven married the woman cited in the divorce case - Lady Rosemary Mactaggart - and Hamilton discovered she had a stepmother she had no hope of getting on with. The divorced wife of a wealthy property tycoon, Lady Rosemary had in 1968 been dubbed ''the Scottish Lady Chatterley'' by the tabloids after an affair with an ex-Commando, Richard Cawthorne, who was the shooting instructor and keeper at her Knockie Lodge luxury hotel in Inverness-shire. The fallout when the two-year relationship ended was spectacular - Cawthorne attempted to murder Lady Rosemary and three others while holding them under armed siege. He was jailed for nine years.

''She was quite notorious in her day in Scotland,'' says Hamilton of her late stepmother. ''My father said when he left Rosemary that she was the kind of woman who set up men to try and shoot her. The only mystery is why Richard Cawthorne missed. She was a nightmare, an evil woman, I thought. In fact, I keep promising that her story will be the basis for my next novel - and it will be one of these days.

''When I failed my exams, she said, 'It's no problem. She's so stupid she can be a deb and marry a rich man.' Rosemary enjoyed making me feel stupid, so they set me up to come out. I was this great fat thing in a white dress. Ghastly. I came out with all these amazing people

like Camilla de Ferranti, and loads of other incredibly rich people - a lot of stuffed shirts, actually. I went through agonies because I was awkward and not at all glamorous. I just didn't fit in with all those Hoorays. Again, I felt like this great big misfit. My life was a grey, aimless muddle.''

At 18, Hamilton was damned after being described as ''intelligent'' by the ineffably snooty diarist in Harpers & Queen. It was the most deadly epithet a debutante could face, so she fled the party scene. A year later she met what she describes as a nice, intelligent man. ''I should never, ever have married him. I made the mistake of telling Dad 'Dick would like to marry me'.'' In no time at all Hamilton was on Islay getting married, pumped full of Valium in an attempt to soothe the headache she had

suffered for days. ''It was not a joyful event,'' she says. ''People still talk about it because of the magical setting and how everything was amazing, but I feel as if I wasn't there.''

The marriage lasted a year. ''I left once, but my father made me go back,'' she says. ''By this time he was on to his third wife, after his marriage to Rosemary was dissolved in 1986. He then

married a Polish woman, Malgorzata Maria Hruzik-Mazurkiewicz, who has now seen to it that he has received the Grand Order of the

Polish Cow Pat or something [the Polish

Commander Cross, Order of Merit]. Finally, I ran away to London - we were living in

Cambridge - and what did I do? I met somebody else. I was a complete baby, a girl on the run. This man was embroiled in the most dreadful divorce and I think that's why I was drawn to him. You are often attracted to the most

negative aspects of your own life and I think that is one of the things that bound us.''

By the time she was 21, Hamilton had married again and soon gave birth to Sophie and Annabel. ''And guess what?'' says the writer, barely waiting for a response. ''Another hideous divorce fight. My third, if you count my parents. I was far too young to realise that if a man behaves badly towards his first wife, then it's highly likely that he'll do it again.''

The following decade brought more chaos and heartache as Hamilton worried constantly about how to support her daughters. She no longer communicates with her second husband, Steven. ''Of course now it doesn't matter at all,'' she says, resignedly. With her husband's solicitor consistently telling her to get a job, she felt helpless. ''What job was I supposed to do? I had no training, but I knew I could be a writer and had already had my first novel, The Idle Hill of Summer, published. So I had this great struggle about writing and bringing up children and

generally coping on my own.''

While in the throes of the divorce from her second husband, Hamilton took a long look at herself and didn't like what she saw. At 35, she was a single parent with two small daughters and no money. One September evening, she picked up the phone in her London home and called the Samaritans. Full of apologies, she told them she wanted to die. She was desperate. ''I was suicidally depressed,'' she says, without a trace of self-pity. ''I was in yet another difficult relationship with a man and because I had been brought up to stick things out, however dreadful, I had always been good at putting a brave face on things. I've learned that is a dangerous thing to do.'' The Samaritans talked her back from the abyss of depression, she says. ''I don't know what would have happened to me if I

hadn't made that call. Life was difficult. Every Saturday morning there was another solicitor's letter and another bill. I never knew if my

husband was going to pay the maintenance for the children every month. It was awful. If I had told my friends that I wanted to kill myself they would have just said, 'You can't; you've got children.' So you stop saying it after a while. I honestly don't know whether I would have done it, but I got bloody near it.''

Hamilton, who comes across as enormously warm but shy, believes all she needed was someone to talk to. ''In my family we didn't talk, long before we weren't even speaking to

each other.'' The Samaritans, she says, took her seriously and didn't judge her - for the first

time in her life, her accent and her background were irrelevant.

Now relatively happy and producing a book a year, Hamilton believes her dark moments are behind her. She tends to deal with her emotions rather than bottling them up, and has married a man who, she says, regards her as his intellectual equal. A few days after the interview I meet the couple at the Chelsea Arts Club in London for dinner and their behaviour suggests this is a true marriage of minds. Hamilton's daughters have proved themselves academically - the oldest is reading classics at Oxford and the younger goes to Edinburgh University this autumn to study French. Revenge, Hamilton has found, like the heroine of Other People's Rules, is a dish best eaten cold.

Her latest book has a delightfully happy ending - just like her own story, she says, brushing crumbs from her smart black skirt and wrapping herself into an elegant camel coat. She sees writing as a way of trying to lay to rest her demons - the broken family ties, tragic love affairs and damaged relationships that have bedevilled the Hamilton family. She admits her own love story is the stuff of fiction. She and Mostyn have been friends for more than five years, having been set up by mutual friends. After a platonic relationship, romance was sparked two years ago when Hamilton's long, difficult relationship with an artist finally ended. ''I met Trevor again and we fell madly in love. We had this whirlwind romance - me in my forties, him 55 - and it was all very exciting and rather unbecoming in some ways, but it's totally changed my life.''

Hamilton has let her Hammersmith flat and moved into Mostyn's apartment. Her life is ''heaven, just bliss'', she says, looking unsettlingly happy. ''I feel I have got a whole new start in life. Things had been ghastly for me for such a long time.''

The past has finally been snipped off, she says crisply. ''I have been the victim of dreadful

family breakdown and the perpetrator of it, too, sadly. The fall-out has been appalling. Yes, I do rather regret that my father refuses to speak to me, but I hope that maybe the new husband can be waved in front of him like a magic wand. Who knows?''

Hamilton realises now that during the years when she felt she had no one to talk to, she was working through one emotional upheaval after another in her novels. ''I think I took my own family far too seriously. I've definitely had bad mental hygiene problems, as my older daughter puts it. You can't go on torturing yourself about the past forever, so I fully intend to enjoy the future - with knobs on.'' n

Forbidden Fruits is published by HarperCollins on Monday