AT SIX years old I knew that I was gay, but I kept hoping it would go away. I remember having sexual dreams involving other boys - and men - but when someone kissed me in a dream, I realised it was not only sexual, it was romantic to love another man the way a man loves a woman.

For a long time I didn't go to bed with anyone, male or female. I think part of my reasoning was that, if I didn't act on it, it might eventually go away . . . I might grow out of it, the right girl would come along.

I loved the movie Vertigo, it's still my favourite, in which Jimmy Stewart is hired to track a beautiful woman, played by Kim Novak. To me Kim Novak was the most beautiful, ethereal woman I had ever seen. I'd never seen a woman like that in real life, but I assumed that if I ever did, my homosexuality would go away and I would fall into her arms and everything would be all right.

I made a couple of valiant efforts at becoming heterosexual. I asked a sexy girl in my class to go to the drive-in and we fogged up the windows for about 20 minutes. I got quite passionate with my kissing, then I felt I'd done my duty and drove her home.

But, deep down, I knew who I was attracted to. I knew I wasn't attracted to girls, that my sister's boyfriends were enormously attractive to me.

At 25 I finally started having sex. I was an ensign in the navy, stationed in Charleston, South Carolina, living in a house that was a few blocks from the Battery, a lovely park where two rivers, the Ashley and the Cooper, join. Charlestonians always say, rather grandly, that the Ashley and the Cooper flow down to make up the Atlantic Ocean.

Anyway, I was down at the Battery, sitting there in all innocence watching the moonlight on the water, probably the last time I ever sat in a park at night in all innocence. A man came up and asked me if I had the time, and I told him I didn't. He stuck around a little bit longer, and then I realised what he was up to. I said rather curtly: 'I'm not what you're looking for.' He apologised and left.

I sat there for another 10 minutes, and decided perhaps I was what he was looking for, went back and found him and invited him back to my house.

It was a thoroughly unsatisfactory, unromantic, unsexy experience, mostly because I was so terrified. And the next morning I thought, well, that was no fun at all, perhaps I'm not gay. I felt relieved.

Twenty-four hours passed, and it occurred to me there might be someone in the same place who was more attractive than that man. So I went back - and I went back - I had three or four experiences picking up people.

One night I told a friend from work that I was gay. We went and had a drink and I just spilled the beans. He was straight and I was prepared for him to rebuff me, but he was very matter-of-fact about it. He said: 'Well, I still think you're a good guy and I'd still like you to be my friend.' That was a huge relief.

In fact, telling the truth about myself was so exhilarating I wanted to keep doing it, and I realised that Charleston was not the place for me.

I went to bed with a man one night and experienced what seemed to be a sort of closeness with him. When I saw him the next morning at a local society event, he cut me cold. He refused to acknowledge my existence in the room, much less the fact that we'd slept in the same bed the night before.

I piled everything into my car and drove across the United States to San Francisco. What I found was not only a town with large numbers of gay people, but one where the straight folk were more blase about my sexuality than I was. It was the acceptance of straight people that finally made me completely comfortable with myself.

In fact, I was so excited at being out of the closet that I came out to everyone. I couldn't take a cab ride across town without telling cab drivers I was gay. I bored people silly with it.

A few weeks later my father found out about it. His first reaction was rather ugly. My mother was suffering from cancer and my father wrote me a letter saying I was making it worse.

In fact, my mother had known for several years without telling me. She was the keeper of secrets in the family, which is one of those duties that Southern women take on. There were lots of secrets in my family. I was really the first person to start openly telling the truth about everything.

She became my greatest ally once she'd come to grips with my being gay. She was such a good mother that all she wanted was for me to find someone nice. So it's always been a great sadness to me that she never got to meet my boyfriend, Terry, because I know she would have adored him.

I went back home to North Carolina to be with her when she was dying. My father and I slept on the floor of her hospital room the night before she died, and he told me he had suspected I was gay when I was a teenager and was sorry he hadn't brought it up earlier because it might have made things easier for me.

I think he apologised to me because my mother told him to. I think it was her last request to him.

'Maybe the Moon', Armistead Maupin's latest book, is published by Bantam Press.

(Photograph omitted)