On the narrow lanes that lead towards the Anjuna flea market, impromptu convoys of motorbikes and scooters weave around the ubiquitous cows and bump over the potholes, heading in the direction of the beach.

Their riders are an odd mix: the hippies, semi-naked with their intricate tattoos and wraparound shades, straddling old Enfield Bullets, studiously ignoring the fat, pink, middle-aged package tourists clinging nervously to their scooter handlebars and wishing they were sipping their first cool Kingfisher beer of the day. These men, too, have discarded their shirts, preferring to expose their beer bellies to the sun; the women favour strappy vest tops and shorts that ruck up around the thighs. If they notice the cold stares they receive from some of the local people who move among them, it does not show.

The sun is bakingly hot, sitting high in the deep blue sky above the gently waving coconut palms, the light glinting off the waves rolling gently on to the sand. This is the Goa most people know: the relaxed, freewheeling, former Portuguese colony which opens its arms to visitors of all kinds and so appealed to the hippies who flocked here in the late 1960s that some have never left.

Yet something poisonous has entered Eden. Beneath the surface lies a seething mass of tensions and hatreds. A spate of high-profile attacks on western tourists, including the murder of British teenager Scarlett Keeling, is the most obvious symptom of the malaise. A state-sponsored land grab of expatriates' properties, the influx of Russian and Indian property developers, and even a threat to ban the wearing of bikinis has convinced many long-term stayers that the time to leave has come.

Many are alarmed by the failure to get to grips with the crime problem. It was on Anjuna beach that 15-year-old Scarlett's body was found two years ago. She had been battered and raped after an evening drinking and taking drugs while her mother, Fiona MacKeown, was travelling elsewhere in India. Yet it was MacKeown's vehement protests that led the police to revise their initial conclusion that the teenager had drowned accidentally.

In a week's time, a court in the state capital, Panaji, will start to hear evidence against two men accused of her killing. Not her murder, though, a point that rankles with some European residents who think that the authorities disapproved of her family's unconventional lifestyle. They point to the murder charges brought against a Russian last month after a local man died in a late-night brawl in Morjim and ask whether there is one law for Indians and another for those from abroad.

Even the state's tourism minister, Francisco "Mickky" Pacheco, has admitted that the lax police response to attacks on foreigners is in danger of earning Goa the title of the "rape capital of India". The jailing last week of a waiter at a beach bar for the murder of a former social worker, Denise Higgins, in April 2007 goes some way to explain why even the most law-abiding foreigners are afraid. Higgins, 52, from Oxfordshire, was stabbed in her own home after befriending the man and his family.

One British expat pensioner is so scared she says she now sleeps with a knife in her bed in case of attack. The underlying tensions bubble to the surface in the letters pages of the local papers and the internet forums of the expats, which teem with bitter accusations of racism, colonial arrogance and local mendacity. A letter to the Herald newspaper last month was typical. Foreigners were opening businesses and taking away the livelihood of the locals, the writer complained, before explaining that foreigners also "gift us various diseases like Aids, among other strange viruses and influenzas due to mutation and mixing of blood".

On the popular British Expats Discussion Forum, Darren (a former resident of Goa who decamped to Vietnam) describes it as a "corrupt, unlawful and dangerous" place populated by lazy and thuggish young people who are distorted by "jealousy, greed and selfishness". This prompts another expat to dismiss the place as a "dirty shithole".

Once Goa was in Indian hands, it was not long before the first hippies arrived, heading first for the area around Anjuna and Vagator beaches, which became famous for its beach parties and drug culture. The state remained a hippie haven for much of the 70s. In the early 80s, it was all New Age, to be replaced as the decade wore on by the growth in electronic music which eventually moved into the trance scene, with full-moon parties on beaches and at other open-air venues, a trend that continued into the 90s, despite an initial police clampdown. But mass tourism had also discovered Goa. While a range of five-star hotels sprang up in the south, the north welcomed cheap package tourism.

So how did things get so bad? In 2006, there was a sudden influx of Russian and Indian developers from Delhi and Mumbai. Large tracts of land originally designated for agriculture were converted to residential use amid accusations of corruption up to ministerial level. As prices rose, local people suddenly found they were being priced out of the market. It was also clear that such large-scale development would place additional strain on already limited resources such as water and electricity. The following year, the state assembly elections were fought against a backdrop of a campaign to save Goa from the newcomers.

Caught in the backlash were thousands of foreigners who had sunk their life savings into homes there. To their horror, the goalposts were moved and many properties had their residential use revoked. Some of those caught by the switch had undoubtedly made use of loopholes in the law, but hundreds of others who were sure they had done everything above board were also caught in the net. Worse still, under the 1999 foreign exchange management act they should not have bought the land either, and the offence they have now retrospectively committed carries with it a fine of three times the value of the land and the possibility of confiscation.

Others found that the rules on other documentation had changed, as had the way residency was defined. The government wasted little time in moving against them.

Nick Papa, 47, and Mick Cooper, 65, received their warning notices on 14 December 2008. They arrived 10 years ago after falling for Goa on holiday and sank their life savings into setting up home. They thought they had found heaven when they bought their elegantly presented house on a hillside in the village of Aldona in north Goa, paying three million rupees (£44,500) for it and spending more than half as much again doing it up.

Now, like so many others, they are determined to leave. Though the couple, from south Croydon, insist they stuck by the rules and have the paperwork to prove it, their nightmare is that, without government approval, they cannot sell. Even if they can find someone prepared to take their property off their hands for a reduced sum, they are barred from taking the money out of the country. The British high commission has taken up the issue with the Indian government, but warns that it cannot interfere in the legal process.

"It's a racist attack," said Cooper. "They are going to kill people with the stress. I know one woman who has tried to slit her wrists three times. Why has the government got this hatred for foreigners?" Papa joined in: "It all goes back to 2006 and the publicity about foreigners buying up property which inflamed feelings and made the locals think that inflation was because of the western influence."

"Now you get called a white bastard and white trash," said Cooper. "When we moved here it was like living in paradise. Now we are being held hostage. We want to sell up and go home. It's not a safe place to be any more."

Vikram Varma, the lawyer representing many of the British owners, says part of the problem lies in a conservative mindset among some of the local population. "You have a set of people who are warm and friendly towards foreign nationals, with open minds and contemporary thinking. But you also have a certain set of people who are against change of any sort," he said.

To compound the expats' misery, India has changed the rules on tourist visas, curtailing the length of stay and imposing a two-month ban on returning to the country. Once British tourists might stay six months, fly to Colombo and return with a new six-month visa, but now they are shut out. Though this change is under review, it spells the end for many who took advantage of the situation to make India their home.

Varma thinks the government has its priorities wrong: "We have nearly half a million Bangladeshis coming in illegally to India. They enter without documents and are a major drain on the economy. We have far fewer western tourists coming to Goa, and they come with intellectual and financial capital. They are an asset. The charm of Goa is its international visitors. It is what makes Goa different from the rest of India."

Goa, with its little white churches and elegant casas set among beautifully tended gardens, has always been a little different from the rest of India, more cosmopolitan, with a more open outlook. The Portuguese were here for 450 years and it was still a colony long after the British left, until December 1961 when 30,000 Indian troops overwhelmed the 3,000 Portuguese defenders. The fighting was over in 48 hours. But rather than liberation, many older Goans regarded it as annexation by a foreign power. Some now feel that, as people move in from poorer states to fill the menial jobs Goans will not perform, the character of the state is changing.

One elderly Indian in a village near Anjuna sums it up in words that have uncomfortable historical echoes. "The problem is the blacks [the non-Goan Indians]. Look," she said, pointing at a plastic bottle tossed into her beautiful garden from the street, "that's what they do, they are dirty people."

As tensions rise, the tourist industry, so crucial to the state, is suffering. About 2.4 million tourists visit every year, including an estimated 200,000 Britons, and it is the British – about 3,300 of them – who make up the majority of the 5,000 foreign residents. But though Indian tourist numbers are rising, foreign visitors are down for the second consecutive year.

Lyndon Monteiro, vice-chairman of Goa's tourism development corporation, has the tough job of trying to reverse the decline. He said the state had no choice but to implement national laws, but insisted that everyone was welcome in Goa, irrespective of where they come from. But he added that visitors must try harder to fit in.

"They must also respect the local culture, the law of the land and the people's sentiments," he said. "Definitely, we would advise our honoured guests to dress modestly. It is very bad manners for a man to go shirtless in a supermarket or for a woman to wear a bikini."

While the British fight on, the authorities have claimed their first victims, fining a Swiss couple 200,000 rupees (£3,000) and issuing them with a confiscation order. Sitting on the veranda of their small guest-house in the heart of Anjuna, August and Ruth Thommen shake their heads at the injustice of it all. August is 69, Ruth 10 years younger but suffering from suspected bone cancer. They look worn out by the strain. August apologised that he had to leave: he had to go to the bank to withdraw the draft to pay the fine.

They bought the place 15 years ago after falling in love with Goa as holidaymakers. Now they, too, want to get out. "This is just robbery," said Ruth. "I think the government would like to kill us like in a war. This is our heart, our life. We never thought we would go back to Switzerland, we would die here, but now it is finished." She lit a cigarette and drew on it hard, reflecting on the visitors she had seen over the years. "I saw Scarlett the morning before she died and she was completely stoned," she said. "Everyone knew her here. She was a beautiful girl, but her problem was drugs and alcohol. I can't understand how the mother can leave her like that."

She took another drag on the cigarette, and shook her head: "When we arrived the people were more friendly, now it is all money, money, money, and cheating and lying."