Bestsellers: The first three Harry Potter books - Rowling has said from the outset that there will be seven in total. Right: Rowling's own first sketch of the Sorting Hat proved to be itself auspicious

Scene One: May 1997, a sunlit cafe in Edinburgh: Joanne Rowling explains how she came to write a children's book with the aid of a Scottish Arts Council grant - all that stood between her and Income Support. Rowling and her publishers, Bloomsbury, are delighted with The Herald's interest in the draft of her first novel, Harry Potter and the Philosopher's Stone. High on espresso and Marlboro Lights, the striking redhead in the blue silk jacket tells her tale. The atmosphere is celebratory.

Scene Two: May 2000, a half-lit hotel room in Edinburgh: a tranch of phonecalls, faxes, and a signature on a secrecy agreement have secured The Herald one of five interviews JK Rowling has agreed to in advance of today's publication of Harry Potter and the Goblet of Fire. I've one hour. Marlboro Lights still feature, but the coffee is decaff. Despite a stylish, aromatic red, soft suede jacket, JK, now blonde, looks pale and drawn.

The reason emerges soon enough. It explains the late delivery of the manuscript, rumours of reclusiveness, queries about her mental health. In the ''muggle'' (non magic) world, where there's no wand to wave, she had survived an encounter as bruising as those between Harry and Voldemort, the evil wizard. Rowling's adversary was the unwieldy plot of what she insists on calling Book Four.

''Halfway through writing Four, I realised there was a serious fault with the plot and that had never happened to me before. The problem I'd given Harry was completely solvable and if I solved it then, I couldn't reach the end I needed to get to. I've had some of my blackest moments with this book. At Christmas I sank to the depths: 'Can I do this?' I asked myself. In the end it was just persistence, sheer bloody mindedness. It took months. I had to unpick lots of what I'd written and take a different route to the ending. One chapter I rewrote 13 times, though no-one who has read it can spot which one or know the pain it caused me.'' She rattles it out, barely pausing to inhale.

Rowling, 34, admits this pain was largely self-inflicted. Unlike other literary megastars, whose creative muse is constantly under threat from greedy publishers desperate for the next bestseller, it was Joanne herself who declared from the start that there were to be seven Potter books. Like her hero, the structure of the series seems to have sprung from her imagination fully formed during a momentous train journey from Manchester to London in 1990.

There was a period of writer's block during the creation of the second book (Harry Potter and the Chamber of Secrets) as publicity surrounding Philosopher's Stone started to kick in but, that apart, her relentless desire to excavate and present her characters has carried her through . . . until now.

In the third book, Harry Potter and the Prisoner of Azkaban, the deathlike dementors, who have the power to suck happiness out of a person's life, are a metaphor for depression. Around the end of last year, Rowling felt like one of their victims. She says: ''Azkaban was a lot of pleasure to write. Four was part joy, part hell on earth.'' Because the plots for all seven books are already sketched, it was imperative that Harry arrive at the place pre-ordained for him at the end of the fourth book. This book was always intended to be longer than the others but her editor at Bloomsbury must have blanched when the manuscript finally arrived. It was 250,000 words long. Most novels aimed at the bottom of her target age range (around eight) are no more 80,000. Rowling is unrepentant: ''I knew this book would be longer than Azkaban but I didn't know how much. That's how many words I needed to tell

the story. Always I have this problem. Until all seven books have been published, I'm not free to discuss why I had to put particular things in particular books.'' (Five and Six will be shorter, she says, but Seven may be as long as Four.)

After our interview, I asked one of just four people to have read the manuscript at that point, whether an eight or nine-year-old would be capable of following the plot and have the staying power to turn 640 pages. ''It is very complicated with lots of twists and turns, but I'm sure they'll cope. For kids who can't get enough of Harry Potter, it's a feast,'' she said.

Rowling is more guarded: ''The most important thing for me is that I keep writing the story I've set out to write. When I write Book Seven, even if everyone says, 'Well, she went completely off the rails after Book Three,' I'll know that I've stayed true to what I'd planned.''

Having come up with the cunning wheeze of publishing the third book at 3.45pm on July 8 last year (ostensibly to prevent English schoolchildren from bunking school to get it), this time Bloomsbury adopted the simple tactic of imposing quasi state secrecy on everything about the book, right down to its title - originally Harry Potter and the Doomspell Tournament.

It features the World Cup in Quidditch, the exciting and dangerous polo-type game played on broomsticks and invented by Rowling in a pub in Manchester after a row with a boyfriend. The dreadful Dudley is finally put on a diet and there are several completely new characters.

My guess is that despite its unwieldiness, millions of children (and lots of adults too) will race through Book Four, because Joanne Rowling has created in us a huge desire to answer one central question: ''Who is Harry Potter?''

The fact that he's an orphan, quite a rarity in the West today, is less significant than why. The orphan is a perennial theme in children's literature because it engages the reader's sympathy, liberates the central character from parental constraints and is a metaphor for the human quest for identity.

''But, as I've shown already, the death of his parents is far more integral to the plot than merely a way of launching him into the world alone,'' she says. Before he even arrives at Hogwarts School of Witchcraft and Wizardry, we know Harry is ''different'', even though he has some characteristics in common with lots of other 11-year olds: myopia, unruly hair, a great sense of fun. First, there's the lightning-shaped scar on his forehead. Then there was the incident when he appeared to have charmed a Brazilian boa constrictor out of its cage.

On his first night at the school, he encounters the Sorting Hat, which assesses each new pupil and assigns a house. ''Difficult. Very difficult. Plenty of courage, I see. Not a bad mind, either. There's talent, oh my goodness, yes - and a nice thirst to prove yourself, now that's interesting . . . So where shall I put you?'' Why does the hat swither, nearly placing Potter in slithery, devious Slytherin before sending him to glorious Gryffindor? Is there a dark side to this character?

In her analysis for the Telling Tales book, Lindsey Fraser, director of the Scottish Book Trust, ponders the significance of the incident where Harry chooses his wand, which includes holly and a phoenix feather. The salesman, Mr Oilivander, observes: ''It so happens that the phoenix whose feather is in your wand gave another feather - just one other. It is very curious indeed that you should be destined for this wand when its brother - why its brother gave you that scar.'' Most significant of all, one suspects, is that Harry is ''the boy who lived!'' when Professor McGonagall asks the supposedly all-knowing headmaster, Albus Dumbledore. ''How in the name of heaven did Harry survive?'' (the murderous attack that killed his parents), the latter can't answer. ''We can only guess,'' said Dumbledore, ''we may never know.''

JK knows but isn't telling . . . yet. ''Harry is vulnerable. He's suffered. He's damaged in some ways. These books are about why he continues to struggle against evil. Why doesn't he give in when it would be easier for him to go to bed and let someone else sort it out? You'll find out my answer. One reason, of course, is that it makes a far better story.''

After all the brouhaha from right-wing Fundamentalists, it would be ironic if Potter turns out to be a cipher for Christ. After all, we know already that he is a saviour. We know he is partly human, that he can be tempted, that he's no goody-goody. If anyone's taking bets on the denouement of Book Seven, the most popular scenario must be something like the great duel to the death between Sherlock Holmes and arch villain, Moriarty. Rowling believes in God, or at least A god, and sometimes goes to church near her home in Edinburgh, ''though my attendance record hasn't been too good recently''.

Ask her about the South Carolina banning row and witness something approaching spontaneous combustion: ''They have a perfect right to tell their children what to read but I think their stance is nonsensical. I saw a guy on television in the States, saying I'm in danger of putting negative things in children's heads. What was he on? There are negative things in children's heads already.'' She has faith that most readers will accept that her use of magic is a device to give characters the power to handle situations that would defeat mere Muggles.

''I don't believe these things and I'm certainly not encouraging any child to take an interest in the occult,'' she says, but admits to being taken at face value on occasion. ''In America, I've had practising witches coming up to me and saying thank you. I tell them not to. I don't consider them evil but I don't believe in what they do.''

In fact, initially, it was the comic potential of magic that appealed to her, more than its scary properties: turning mice into snuff-boxes, beetles into buttons etc and what happened when things went wrong. And for the purposes of the plot, she needed children to be able to outsmart adults. At the same time, it would have been impossible to create tension if everything had been susceptible to magic: that's why Rowling dislikes fantasies. ''I don't find there's sufficient logic underpinning the worlds that have been created. For me one of the big challenges was to make sure I knew the laws, both physical laws and the legal system within the wizarding world because until you know the boundaries, there's no tension.''

One of her fundamentals is that you can't reverse death: ''That's a given. Without it the plot would fall apart, though in Book Seven you'll see just how close you can get to the dead. You can be brought back from being petrified and from injuries that in the real world are mortal, depending on the degree of skill that a particular wizard possesses. You can't go to any wizard and say 'Will you cure my terminally ill relative?' It's a mirror image of the real world in that sense.''

Lots of children's authors claim they have the ability to remember exactly what it was like to be a child. Generally, their work doesn't fully bear that out. In Rowling's case it does. The central characters are all based loosely on people she's known. She has most often identified herself with Hermione, the gutsy but tense and insecure class clever-clogs.

But she now admits there's a lot of herself in Harry too: ''He's a better person than I am. He has the qualities I most admire. He's very unselfpitying. It's not that he's not vulnerable to worry but he's morally and physically brave and I aspire to that.''

The character of Harry's best mate, Ron, is inspired by her oldest friend, Sean Harris. It was Sean who arrived at Joanne's school when she was a teenager and her mother was dying of multiple sclerosis, and whisked her off in his in his escape vehicle - a turquoise Ford Anglia, the very model that assumes the power of flight in Chamber of Secrets, the book dedicated to him. It was also Sean who put down the deposit on her tiny flat when she arrived in Edinburgh with a baby and no money after the collapse of her marriage to a Portuguese journalist.

Some of Rowling's minor characters also have human counterparts. There's a hint of a dog-obsessed grandmother in Dudley's inflatable Aunt Marge. Ernie the erratic driver of the Knight Bus and Stanley, the yokelish conductor, are named after her two grandfathers, both great characters. Snape is a compendium of all the bullying teachers she ever encountered. And the effete Gilderoy Lockhart, the second Defence Against the Dark Arts teacher, who is eaten up by his own vanity? She chuckles, throws her head back, then leans in conspiratorially: ''Believe it or not he is faithfully represented. Circumstances forced us together for a brief period. I'll only say that it gave me an enormous amount of satisfaction to write him.''

Dumbledore, the affable head who is forever humming to himself, comes from the Old English ''bumblebee''.

Maybe it's not surprising that a girl who once hailed from Chipping Sodbury is obsessed by names. She covered four sides of A4 before coming up with perhaps her best one yet: ''quidditch''. Its biggest rival, ''muggles'', is derived from ''mug'' but the suffix conveys an endearing quality. It's a reflection of the way wizards regard them - more to be pitied than despised. The word has attracted a lawsuit from one Nancy Stouffer, who claims to own the trademark on the word muggle and alleges Rowling's plots and characters originated with her. Rowling's American publishers, Scholastic, are dismissive: ''Success often leads to frivolous claims.''

Apart from the vocabulary, another source of great pleasure to Rowling and her fans is the mass of amusing detail in her books. ''I've got a broad outline for each book but I leave myself wide latitude to find different ways of doing things. Otherwise half the pleasure would be gone. I've got bits of Six and Seven written in old notebooks. Sometimes they get used verbatim, sometimes not at all. Sometimes something I've discarded crops up later. In Philosopher's Stone I had a game of chess between Harry and Ron which Ron won by using a particularly violent bishop. My editor made me take it out. He didn't want me to have a bad bishop. Well, he's back, I have a different editor now.''

Is she braced for the latest round of hype surrounding her name? We joke that each time we've met since 1997, we think the publicity is as OTT as it's going to get and we're always wrong. Third richest woman in Britain/one of 100 people in the world with the ''It'' factor/Most eligible woman in Scotland. Where would it stop? ''I thought we'd reached saturation point the last time. I didn't think it could get more weird but, boy, was I wrong! The American tour knocked me for six. At times it was scary. You know you've sold a lot of books but there's no guarantee that will translate into bodies turning up at 9am to get their copy signed. In Boston, we drove up, looking for the back of the store and there were people lining the streets. I said to Kris from Scholastic: 'Is there a sale on or something?' but as soon as I'd said it I twigged. They were there for me, 2000 of them.

''We got in the back and up through the store but when I walked out, there was this blinding flash of cameras and everyone started clapping. Then the screaming began. I started signing like crazy.'' She signed 1400 books that day.

How did all this effect her writing? ''It's difficult to disentangle what made Book Four hard. Mostly it was of my own making. It didn't help to be having this trauma and then to go into the kitchen for my nanny to be saying: 'You're in the papers again.' I think I'm quite good at blocking it out. If I wasn't I'd go insane.''

In some ways Rowling is a typical victim of success. At first she was so glad to be published she did everything her publishers told her would raise the profile of her book. The story of the girl with nothing but a baby and a half-written manuscript, writing in cafes and living in a one-bedroom flat, was rehearsed so often it began to sound like a back-to-front Country and Western song. ''At the time, it didn't feel like a fairytale. I was doing what I was best at and kept doing it against pretty difficult odds.'' Now Rowling is fighting new myths. Journalists refused interviews depict her as harridan or Dietrich-style recluse. Running scared is nearer the mark: ''I had a crisis and I didn't know if I could solve it. I was working 10 hours a day. I don't hate interviews but if it's a choice between doing an interview and half a chapter, I knew what I had to choose.''

Shortly after we first met, the two of us had a long telephone conversation about creating a dividing line between the public and private JK Rowling. In our latest encounter I feel slightly hoisted with my own petard. This is the sum of what she has decided to say about the fact that she still lives with Jessica (seven) in a two-bedroom flat in a not very elegant part of Edinburgh, still does her own supermarket shopping and stoically continues to clean out the rabbit hutch, despite her multi-million pound fortune. ''I live the way I want to live. That's what seems to bug people. I've never wanted to own race horses. I never wanted a yacht. Just because you can do those things, there's no reason why you have to. It means Jessica and I go places I couldn't have afforded. I do fun stuff but it's low key. That's what I want. I don't sit round worrying about what people think about my life because

that way lies insanity. What people forget is that I'm still a single parent. Quite often I run up against the perception: 'You've got money now so that problem is taken care of.' Well, I didn't have a child so that when I could afford 24-hour childcare I'd use it. There's still the problem of people phoning up and me saying: 'I'm just about to put her in the bath. Sorry, bye.'

''In all of this madness, I'm still trying to bring up my child, mostly by myself. At the moment, priority No 1 is Jessica, priority No 2 is the quality of the books and there are lots of things jockeying for third place.'' So any big projects, such as seeking out and publishing the next JK Rowling, will have to wait ''around five years''. Against the odds perhaps, she's made two important friendships this year. ''One of them said to me: 'If I'd known who you were, I probably wouldn't have spoken to you'.''

Now the hype is about to ratchet up a notch because Warner Bros is embarking on a screen version of Harry Potter. At first, Joanne said no: ''Children will go to the film wanting to see their Hogwarts on screen and it won't be there. Finally, I thought, I'd like them to make it while I'm alive and can have my say rather than wait till I snuff it, only for Hogwarts to turn into Hogwarts High. I'm having a massive amount of input . . . I was very enthusiastic about the first draft.''

Ultimately, what's important about Rowling's work is not the millions of books sold or the movie rights - it is that the Potter phenomenon was initially created not by manipulative marketing but by children delighted by these books telling others about them in the playground. It's easy to forget this amid the ridiculous hype that has surrounded the launch of the third and fourth titles.

My own interest was kindled in January 1997, four months before the publication of the first book, when my then ten-year-old excavated the draft of the first chapter from my briefcase and ten minutes later demanded I phone Bloomsbury to get the rest. This young literary veteran of every classic from Children of the New Forest onwards, remains convinced that the combination of plot, characterisation, pace, and humour mark out these books from everything she's ever read, including the much vaunted Philip Pullman and David Almond.

An experience to relish would be a Primary Seven class let loose on Anthony Holden, the Whitbread judge who, in a recent Observer article, shamelessly plugged his own work then dismissed Rowling's as ''Disney cartoons in words'' and ''less testing than Neighbours''. One read on in vain for any substantiation of such flashy claims, or of his assertion that the characters are two-dimensional and the writing ungrammatical and sentimental.

The nostalgia in these books shouldn't be confused with sentimentality. Yes, her writing is accessible because of its strongly visual quality, but that doesn't mean it is simplistic. Millions of readers love the world Rowling has created and recognise in it parallels with their own lives. Holden's tirade is not the worst she contended with. Frequently it turns out that the bitchiest critics haven't even read the books.

My own favourite passage comes towards the end of Philosopher's Stone. After a great raft of adventures, Harry is roaming Hogwarts on Christmas night when he finds an unfamiliar room containing a magnificent mirror with an encrypted message carved into the ornate gold frame. It translates as: ''I show not your face but your heart's desire.''

Not knowing this, he looks into it and sees a smiling crowd behind him, though the room is empty. The couple at his shoulder look curiously familiar:

''Mum?'' he whispered. ''Dad?''

''. . . The Potters smiled and waved at Harry and he stared hungrily back at them, his hands pressed flat against the glass as though he was hoping to fall right through it and reach them. He had a powerful kind of ache inside him, half joy, half terrible sadness.''

This writing is fresh, vital and strikingly unsentimental. How well it expresses the longing we all feel to be reunited, however briefly, with those we have loved and lost in death. It is also Rowling's favourite passage and you don't need to ask why.

Earlier this year in a Herald competition, a child whose father had recently died of cancer wrote about Philosopher's Stone: ''This is my favourite book ever. When I read it I feel as if I am in the story.''

This is the level of interest Rowling craves. ''Sometimes I think I'm temperamentally suited to being a moderately successful writer, with the focus of attention on the books rather than on me,'' she said recently. ''There are times - and I don't want to sound ungrateful - when I would gladly give back some of the money in exchange for time and peace to write.''

Harry Potter and the Goblet of Fire is published today by Bloomsbury at #14.99 - see our reader offer on Page 11

Telling Tales: An Interview with JK Rowling by Lindsey Fraser (Mammoth #2.99) will be published in August.