CANADA has long been known as one of the world's most welcoming countries for immigrants, and thus a good bet for refugees, who are granted most of the same rights and freedoms as citizens. At first, this open-door policy was a product of necessity. The world's second-biggest country, Canada needed people to fill its wide open spaces and build an economy. But multiculturalism has been a part of the national identity since 1971, when a Liberal government embraced it as official policy. Today 20% of the population is foreign-born. The biggest sources of new arrivals are China, the Philippines and India.

Yet the Conservative minority government of Stephen Harper that took power in 2006 has begun to restrict immigration. It has toughened the citizenship test and doubled the lump sum required to gain quick access as an investor. And it has presented bills to fine and jail people-traffickers and detain their clients, and to penalise unauthorised immigration advisers who charge fees (to be called the Cracking Down on Crooked Consultants Act).

Mr Harper is also changing the profile of immigrants who are accepted, giving priority to the skilled over the needy. His government has cut the refugee intake by 36% and imposed visa requirements on visitors from Mexico and the Czech Republic, some of whom it accuses of exploiting loopholes in the asylum system. The only category of immigrants to have grown significantly since 2005 is temporary workers, who are rarely a drag on the state.

All this adds up to slight tinkering, rather than the kind of retreat from multiculturalism seen in parts of Europe, or America's harder line against illegal immigration. The number of new permanent residents accepted every year has held steady since 1990, at 0.7-0.8% of the population. But the changes reflect Canadians' newly ambivalent attitudes. And they go with an increasingly vocal debate about immigration.

A report on national security published last month by the Macdonald-Laurier Institute, a non-partisan think-tank, listed “uncontrolled immigration” as one of three foreseeable threats to Canada. The federal housing agency pointed to immigration as one reason why renters are having trouble finding accommodation in big cities. A new group called the Centre for Immigration Policy Reform, whose backers include a critic of immigration and multiculturalism, has been set up.

There are exceptions. The Conference Board of Canada, a think-tank, recently credited immigrants with driving innovation in the country. The Aga Khan, the spiritual leader of the world's Shia Ismaili Muslims, has praised Canada's pluralism as an “asset of enormous global value”. But the trend is clear. “If you read the newspapers, the tone is quite negative and sometimes quite racist,” says Hamdi Mohamed, director of an immigrant-settlement organisation in Ottawa.

Public opinion in Canada has been affected by the European backlash and by fears of terrorist attacks (of which Canada has been free in recent years). Recession, though mild, has pushed up unemployment, increasing fears of competition from immigrants. Mr Harper has political reasons to raise the issue. One pollster, Frank Graves of EKOS, says that Conservative voters are twice as likely to believe Canada has too many immigrants as are opposition supporters. And public hostility to immigrants grew after a ship carrying almost 500 Tamil refugees from Sri Lanka arrived off the country's west coast in August.

It is hard to be sure whether this debate heralds a lasting shift in Canada's openness to immigration. The government's proposed detention of refugees trafficked by smugglers has been criticised for violating Canadian law and international agreements. Given immigrants' numbers, bashing them is politically dangerous: they and their children are already a majority in Toronto, the country's most populous city. Aklilu Wendaferew, who works with the homeless and Ethiopian immigrants in Toronto, says the familiarity that comes from living and working with immigrants daily counteracts fears of foreigners, and that employers are not reluctant to hire them.

That seems borne out by an opinion poll commissioned by the government. Only one respondent in four said there were too many immigrants, whereas half said the current level was about right. Canada may be narrowing the door for immigrants, but it is not about to slam it shut.