The first time that I visited the US, my publisher took me to dinner at his club in New York and asked me what it was like to be a writer in India. I thought over how best to describe my existence at home and finally told him "It is like being deep inside a dark cave, quite alone." "With no bou-oum?" he asked with incredulity. "No," I replied, "with no bou-oum at all." Inevitably we were using EM Forster's metaphor of a cave in A Passage to India, since it was the English language and literary tradition that had brought us together.

I should explain what I meant. I was talking about writing in the 1950s and 60s, when it was an act of solitary confinement and the actual existence of writers was no more than a rumour spread by their books. Yes, we had the mighty triumvirate of Mulk Raj Anand, Raja Rao and RK Narayan, as mythical and awe-inspiring to us as gods (I am confining myself to comments on the writing done in English in India) and, a long way behind, there was the triumvirate of women writers to which no one would have thought of attaching the label "mighty" - Attia Hosain, Nayantara Sahgal and Kamala Markandaya. One might find some dusty paperback copies of their novels in shabby bookshops, tossed in with cookery books and those collections of wise sayings and proverbs that publishers of the day liked to bring out.

In this distinctly discouraging atmosphere, one could only withdraw to write without any hope of there being publishers who might want to publish what one wrote, still less of readers who might wish to read it. Readers of the English language almost without exception preferred to read English written in its native land, the only English considered pure and acceptable; PG Wodehouse and Jane Austen clubs flourished. I, too, grew up reading Henry James and DH Lawrence, Virginia Woolf and George Eliot. No Indian author had entered the school or college syllabuses at that time. It dawned on me what a hopeless business it would be to make a living as a writer. No literary agents existed then and I made a list of publishers from the books on my shelves and started sending out the manuscript of my first novel to one after the other.

Finally it was accepted by a small independent publishing house in London that specialised in the work of international authors, often in translation. If I remember correctly, I made £300 from it. At one point the publisher sold translation rights to a Romanian publisher for £10, and I was grateful for that too, because they were willing to take a chance with an unknown writer living in India. RK Narayan, remember, was not published in England until Graham Greene endorsed his work. Why had I not gone to an Indian publisher? Well, there wasn't one interested in publishing fiction by a local author.

Since it was clear that I could not live on my earnings as a novelist, I tried breaking into a related field such as journalism or editing. I approached one or two publishers to ask for an editorial position. I can still see the dark, cluttered office of one who sat dispiritedly fanning himself during a power cut and his look of incomprehension when he asked "Why would you want to work here?" By then I too had lost interest and left without a protest.

There really was nothing to do but retire to one's corner and scribble. In those years my courage was kept up by a neighbour in Old Delhi, the writer Ruth Prawer Jhabvala. It was not so much what she said to me as seeing her live her quiet, domestic life while turning out her marvellous portrayals of our world that made me think that solitude and the lack of response did not really matter if it allowed me to do the one thing that I wanted to do.

I imagined that writers of the indigenous languages lived richer, more active and involved lives, confident of their roles in the world. Unfortunately, I never met them. There was, in those years, an antipathy, a hostility even, towards writing in English - that colonial language that should have been banned outright at independence. I tried to ignore the assumption that mine was the last generation in India that would write in English but shared in the sense that these were its twilight years. The picture changed abruptly, dramatically, in 1981, when a book called Midnight's Children appeared like a thunderbolt and the author was sent to India on that until then unknown exercise, a book tour.

It was the combination of a book that proved that Indian English was a language in itself, capable of presenting serious and important ideas with vigour and originality (GV Desani had done the same in All About H Hatterr but it had been a flash in the pan and led nowhere), and of the author as a personality, that changed the Indian scene overnight. Not only was a whole generation of younger writers (Amitav Ghosh, Vikram Seth, Upmanyu Chatterji) energised and given confidence by the success of Salman Rushdie's book, its language and ideas, but all the discouraged, defeated publishers sat up and took notice of them. And the combination of these two phenomena - a new generation of Indian writers addressing Indian subjects and themes in a language taken from the streets, newspapers, journals and films, and a class of enterprising businessmen who decided they were worth publishing - marked the 80s and 90s. It was a heady time, the climax being the spectacular moment when a British literary agent actually flew to India - did he charter a plane? Did he fly it himself? Never mind, he gave the impression that he did - to sign up an Indian author who went on to win the Booker prize.

Things have never been the same since. By the number of manuscripts that arrive daily and hourly from India on the desks of British and American agents and publishers, I would guess no country has more aspiring writers than ours. While it is curious - and a little sad - that writing only became a "respectable" profession once it began making money, it is very gratifying to know that a young, talented person can make such a choice today and not be consigned to "loser" status. It is actually possible at last to make a living by writing, to be self-supporting and thus self-respecting. The importance of this cannot be stressed enough. As long ago as 1929 Virginia Woolf knew this and wrote of it in her seminal A Room of One's Own

A side-effect has been the proliferation of book festivals and readings. A camaraderie has emerged where there had once been a lonely vacuum. Indian writers can meet and talk to writers from Australia or Cuba or Iceland and, as importantly, see their books placed on tables and shelves along with theirs. Maybe it is a good time to stop and look back at the long curve that has brought us to this point. Having looked, I must admit I find myself inclined to retreat, backwards, into that cave of solitude where I found writing came from, where one can think without interruption and take one's time, where no one is watching or waiting or even interested. After all, that contains a great and wonderful - if daunting - freedom.

• A version of this article appears in the 25th anniversary issue of Wasafiri magazine.