As soon as she arrived in Hong Kong from mainland China in 1999, Yang felt the slights. When a phone disappeared from her college dormitory, she and a friend were immediately suspected and their bags rummaged through. The faces of their classmates clearly showed their distrust of these poor students from “backward” China.

Fourteen years later, as a successful financial professional married to a Hong Kong native, Yang went to the hospital to give birth. The expressions she encountered from other mothers brought those bad feelings flooding back. But this time, instead of condescension, there was scarcely veiled hostility.

“In 1999, Hong Kong people felt a bit superior compared to mainlanders,” she said. “They had no idea about China, but they didn’t feel threatened by Chinese power. Nowadays, there is lots of pushback. People really feel threatened.”

Many Hong Kongers welcomed the end of British colonial rule and accepted the territory’s absorption into China in 1997, especially since the deal was supposed to preserve their autonomy and way of life. But now there is growing resentment about the immigrants and visitors from mainland China.

Nearly 35 million Chinese tourists flooded into Hong Kong in 2012, snapping up everything from luxury goods to imported baby milk powder. Some 30,000 students from the mainland are studying at Hong Kong universities, and many stay on to compete for the best jobs after graduation. Chinese money is pushing up property prices.

Last year, a newspaper advertisement that showed a giant locust perched on the cliffs overlooking Hong Kong complained that mainland mothers were swarming into the territory to give birth to babies who would then be legal residents. While the laws have since been changed to discourage that practice, locals’ feelings of being swamped remain as strong as ever.

An opinion poll conducted by Hong Kong University showed the proportion of 18-to-­29-year-olds identifying themselves primarily with Hong Kong rather than China rose to 84.3 percent in June, from 68.4 percent at the time of the handover and a low of 58.2 percent in 2003.

“Hong Kong was totally unprepared for regional and national integration after 1997,” said Lui Tai Lok, a sociologist at Hong Kong University. “None of us thought of the issues involved in having 35 million tourists a year.”

Until 1997, he said, Beijing had strict controls on population movement, and it was expensive for mainland Chinese to visit Hong Kong. Residents of the former British colony had expected travel to increase after the handover, he said — but in the other direction.

“We just assumed Hong Kong businessmen would go to Guangdong and invest in the Pearl River Delta” in southern China, Lui said.

Wounded pride

But the problem is not just the vast numbers of visitors. Hong Kongers have a sense of wounded pride. “The original design was [that] the Hong Kong manufacturing would take advantage of cheap labor, but now it’s the other way around,” Lui said. “Ten or 20 years down the line, will our kids be happy to be shopkeepers?”

In Hong Kong stores selling luxury goods, mainland Mandarin is more frequently heard than local Cantonese, such is the buying power of the wealthy and free-spending mainlanders. Yang, who asked to be identified only by her family name to avoid controversy, said she tends to be ignored in gold shops if she speaks to salespeople in Cantonese; if she addresses them in Mandarin, she gets plenty of attention.

Tensions are perhaps sharpest in the territory’s universities. Drawn from China’s brightest young people, the mainland students often get better grades than locals. After graduation, with native Mandarin and contacts on the mainland, they are often preferred by employers in Hong Kong, fueling a sense of jealousy, professionals and professors say.

Universities here typically have a “democracy wall” notice board on which students can freely post their opinions. These have become forums for locals and mainland students to spar. At Hong Kong Baptist University recently, a piece of paper saying “Long live the Communist Party” was defaced, while an open letter from two mainland students complained that any social problem in the territory was blamed on them.

“What good will this do?” they asked. “Will so much discrimination really drive us away?”

Yang admits that many mainland students make less of an effort to adapt to the culture here than they would if they studied in the United States, demanding that their own food be served in the cafeteria or that courses be held in Mandarin. Part of the problem, she said, stems from different points of view about Hong Kong’s place in China: While Hong Kongers think of themselves as unique, “Mainlanders don’t view Hong Kong as special; they see it as just another city in China.”

Under a family reunification program, China sends 150 legal immigrants a day to Hong Kong. Many here suspect that the newcomers include Communist Party loyalists sent to help skew local elections in Beijing’s favor.

Immigration also puts pressure on scarce resources, especially for housing and slots in kindergarten.

“We need to fight for hospital beds with mainland mothers,” complained Ronald Leung, leader of a traders’ group protesting cross-border smuggling. “After their child is born, we need to fight for milk powder and diapers. They push up the rent, so we need to pay more for housing. Then we need to fight for school places.”

While some blame the media for fanning resentment, others talk of a clash of values. Hong Kongers, accustomed to British etiquette, complain that mainlanders do not know how to stand in line, that mothers let their children relieve themselves in public, that mainlanders are bringing in corrupt business practices.

Aggravating all this is the heavy hand of the Beijing government. It is not supposed to interfere in Hong Kong’s governance, but it provoked anger last year by trying to impose “patriotic education” in schools here. China’s reluctance to grant Hong Kongers more democracy also creates resentment.

In October, when a 25-year-old woman from southern China was knocked over and killed by a truck, many people reacted with sympathy, but some took to social media to celebrate her death . That incident produced a brief period of soul-searching but no lasting change.

Regina Ip, a pro-Beijing legislator, said the onus is on the Hong Kong government to manage the situation better, to welcome immigrants but also to build more schools and housing, while maintaining the territory’s core values, such as the rule of law.

“We used to look down on mainlanders as country bumpkins, but now they are lording it over us, snapping up expensive properties, queuing up for luxury goods we can’t afford,” she said. “There is a sense of humiliation in a way. But the solution is to strengthen ourselves, rather than complain about competition.”

Zhang Jie contributed to this report.