More people sought asylum in Canada in 2017 than at any point in at least a quarter-century, due in part to a spike in applications from Haitians entering the country from the United States, according to a Pew Research Center analysis of Canadian government data.

The 50,420 asylum applications Canada received in 2017 were more than double the 23,930 it received in 2016. Applications that meet basic eligibility requirements, such as having no serious criminal convictions, are referred to Canada’s Immigration and Refugee Board for further review; the vast majority of applications in 2017 received this referral.

Of the referred cases in 2017, asylum seekers from Haiti (8,286) had the most applications, followed by Nigeria (5,575) and Turkey (2,197). No country saw a bigger increase in referred applications from 2016 to 2017 than Haiti, which had only 631 referred applications in 2016. As a result, Haiti accounted for almost a third (32%) of Canada’s overall increase in referred asylum claims in 2017.

A change in U.S. immigration policy likely contributed to the surge in Haitians migrating to Canada, according to the Canada Border Services Agency, the government’s border and immigration enforcement unit. U.S. President Donald Trump’s administration announced in 2017 that the Temporary Protected Status (TPS) of about 46,000 Haitians living in the U.S. would expire in July 2019 and not be renewed. Immigrants who lose TPS and don’t gain legal protections through another program could be deported.

Also in 2017, Canadian Prime Minister Justin Trudeau said in a highly publicized tweet that Canada welcomed “those fleeing persecution, terror and war.” (Trudeau made the statement after Trump restricted travel into the U.S. from several Muslim-majority countries and paused the U.S. refugee resettlement program.)

The number of asylum applications received by Canada in 2017 is the highest since the country’s Immigration and Refugee Board was created in 1989.

However, Canada has long had far lower numbers of asylum applicants than the U.S., which received more than 142,000 asylum applications in fiscal year 2017. (U.S. totals include only affirmative applications, i.e., applications filed by those already in the U.S.) European Union countries, Norway and Switzerland had even higher numbers, with 672,000 first-time asylum applicants in 2017.

Asylum seekers must be on Canadian soil to begin the process, which can take up to a year or longer. Many have sought asylum upon arrival at an airport or land border checkpoint. In 2017, thousands of people presented themselves to authorities after crossing illegally into Canada along its southern border with the U.S., circumventing an agreement between the two countries that forbids someone from claiming asylum at a border checkpoint.

The Canadian government has started preparing for a possible influx of asylum seekers from Central America this spring, following an announcement that the U.S. government would not renew the Temporary Protected Status program for an estimated 195,000 immigrants from El Salvador. (TPS decisions also loom in 2018 for immigrants from Honduras, Yemen and Somalia.)

Canadian government officials have warned Central Americans and Haitians living in the U.S. that their refugee applications may be rejected if they enter illegally into Canada, which could result in deportation if legal protections aren’t gained through another program. Among asylum cases decided in 2017, about two-thirds of Salvadorans (68%) and Hondurans (67%) and only about a quarter of Haitians (27%) received permission to stay in Canada. By comparison, more than 90% of asylum seekers from Syria, Yemen and Eritrea each had their applications accepted, the highest acceptance rates in 2017.