BARCELONA, Spain -- When Jiajia Wang's parents first moved to Barcelona from China in the 1990s, they had no working papers and spoke no Spanish. The family ate eggs to survive. Her mother and father worked 12-hour days at a Chinese restaurant.
After five years, they bought a restaurant of their own with money borrowed from relatives, interest-free. She and her brother washed the dishes. Her parents slept on a mattress in the bathroom of their cramped apartment so that the children could study at night in the other room.
Today, while Spanish youth unemployment hovers around 50 percent, Ms. Wang, 24, who studied economics at Harvard on a one-year fellowship, juggles four jobs: teaching Mandarin, advising Chinese investors in Spain, running a publishing house and writing romantic novels. She sends home €1,000, or about $1,300, a month to support her parents, who retired last year.
Her family's story is telling of the ways many of Spain's 170,000 Chinese immigrants have managed not only to weather a tough economy but even to thrive, aided by intense labor and a strong Confucian model of family loyalty, while joblessness and cuts to government services have left other Spaniards struggling.
"The Chinese family is less dependent on the government because the family is the welfare state, the bank and social services, all wrapped in one," Ms. Wang said.
"For Chinese people who lived through hardship back home," she added, "working 16-hour days is nothing, and that has made us more resilient during the crisis."
The Spanish government itself seems to have recognized the importance of this success. So determined is it to attract Chinese immigrants that in November it passed a law offering residency permits to foreigners who buy homes worth more than €160,000, with the specific aim of drawing Chinese and Russian investment, lawmakers said.
As hard-hit Spaniards struggle to keep both their jobs and their homes, Spain's Chinese immigrants in Barcelona and Madrid are starting businesses and buying distressed properties from the bursting of Spain's housing bubble.
Of the 8,613 foreigners who started businesses in the past 10 months, 30 percent, or 2,569 were Chinese, according to the National Federation of Self-Employed Workers.
InfoChina Gestión, a real estate company based in Madrid that focuses on Chinese investors, said the number of houses sold for €70,000 to €100,000 to Chinese nearly doubled last year, to 813. Mr. House, a real estate company in Madrid, said it was selling at least 10 houses a month to Chinese, a majority of whom paid at least 80 percent in cash.
The types of work many Chinese immigrants gravitate toward helps explain their success as much as their work ethic. In a time of economic crisis, ubiquitous low-margin Chinese-owned bazaars, hairdressers and supermarkets have become a lure for cost-conscious Spanish consumers.
"If it wasn't for the Chinese shops, it would be harder to scrape by," said Ester Maduerga, 30, a saleswoman at a sports shoe store, as she scanned the notepads, leather belts and plastic alligators at One Hundred and More, a Chinese-owned bazaar here.
Xi Li He, 26, the bazaar's manager and cashier, said the business was flourishing, in part because he had reduced prices by importing inexpensive goods from China. When Mr. Xi, fresh from business school, tried to take a job at a large Spanish retailer, he said his mother doubled his salary.
That kind of success by Chinese immigrants has provided a beachhead of sorts for further investment from China that has pumped some life into an otherwise moribund Spanish economy.
Before Spain's crisis exploded in 2008, Chinese foreign investment in Spain was negligible. By last year, it had grown to €70 million, according to ICEX, a government investment agency.
Ivana Casaburi, a professor of international marketing at Esade business school in Barcelona, said Chinese companies were being drawn to Spain because it offered a low-cost gateway to the European Union, the world's biggest trading bloc.
Isla Ramos Chaves, an executive at the Chinese computer maker Lenovo, said that even with the crisis, Spain -- the fourth-largest economy in the euro zone -- remained a market that Chinese companies were eager to tap. She added that Chinese multinationals in Spain were proving robust, in part because they were anchored by a huge domestic market back home.
Executives at Haier, the Chinese-owned appliance maker, said the economic crisis, rather than being a deterrent, had provided an opportunity, as Spaniards were willing to consider competitively priced washing machines and air-conditioners, even if their brands were less well known.
"I am not sure we would have been as successful if the market was stable and growing," said Santiago Belenguer, the general manager of Haier's Spanish operations.
The success of Chinese newcomers to Spain has not spawned the kind of anti-immigrant backlash seen in some hard-pressed parts of Europe like Greece. Immigration experts said Spain's relatively welcoming attitude reflected its new openness after the repression of the Franco years, when the country was a nation of emigration. Since the crisis, the return of thousands of Latin American immigrants to their home countries from Spain has also relieved pressure on the work force.
That does not mean everyone has championed the success of the Chinese, and some complain of stereotyping and being targeted by law enforcement.
In October, the police arrested 80 people in a nationwide crackdown on Chinese criminal gangs engaged in money-laundering and tax evasion. The police said the low price of Chinese products was being abetted by some importers not declaring shipments from China, thereby avoiding taxes.
Here in Barcelona, José Rodríguez, the owner of A Porta Galega, a traditional tapas cafe in the hip neighborhood of Eixample, said cut-rate prices for everything from beer to shampoo at Chinese-owned shops made it impossible for Spaniards to compete. At least a dozen Chinese-owned tapas bars are scattered along his block.
Still, he added, he would sell his own restaurant to Chinese buyers, "for the right price."
Silvia Taulés contributed reporting.
This article originally appeared in The New York Times.