OTTAWA, ONTARIO (AP) — President Joe Biden and Prime Minister Justin Trudeau on Friday celebrated the close, “inseparable” U.S.-Canada relationship and declared their nations' shared values have never been more important for a world facing both tumult and possibility.

Biden, making his first visit to Canada as president, said the U.S. is lucky to have Canada as its neighbor as both countries grapple with the rapidly changing global economy, climate change, war in Europe and more.

On immigration, Biden and Trudeau used the visit to announce an agreement aiming to stem the flow of asylum seekers at unofficial border crossings from the U.S. to Canada.

The accord eliminates a loophole under existing rules and will allow both countries to turn away asylum seekers at their borders At the same time, however, Canada announced that 15,000 migrants from the Western Hemisphere will be given official slots to apply to enter the country.

Before their speeches before Parliament, the leaders sat down with top aides for a private conversation. Besides Ukraine and defense spending, the wide-ranging talks touched on shared concerns about China's aggressiveness, and violence and political instability in Haiti.

Trudeau noted Beijing’s growing economic power and a need for the U.S. and Canada to work together to address it. To that end, Canada said Friday it was entering an arrangement with IBM to expand domestic research and development and advanced packaging of semiconductors — and planning an investment of up to $250 million to "improve North American competitiveness and supply chain resiliency, help cut pollution, foster economic and national security.”

“With growing competition, including from an increasingly assertive China, there’s no doubt why it matters that we turn to each other now, to build up a North American market, on everything from semiconductors to solar panel batteries,” Trudeau said.

Biden, in his speech, said, “Today our destinies are intertwined and they are inseparable Not because of inevitability of geography, but because it’s a choice, the choice we made again and again.”

“Two people, two countries, in my view sharing one heart.”

On Ukraine, Trudeau vowed that Canada would stand “shoulder-to-shoulder” with the United States in a determined effort to help the embattled country repel Russia’s continuing assault. He also spoke of a need to coordinate even more closely to combat climate change and grow both countries economies.

“We have to stick together,” Trudeau said. “We have to continue to face down authoritarian threats, both at home and abroad. We have to continue to defend what is right. This is not the time to compromise on our values.”

In the balcony, Canadians Michael Kovrig and Michael Spavor, arrested in China in 2018, were on hand for the speeches in Parliament.

The two were taken into custody shortly after Canada arrested Meng Wanzhou, the technology company Huawei’s chief financial officer and the daughter of the company’s founder, on a U.S. extradition request. The Canadians were held for more than than two years in China before the Biden and Trudeau governments managed to win their release. Kovrig is a former diplomat, Spavor a businessman.

“When the plane transporting the two Michaels landed on Canadian soil after more than one thousand days of arbitrary detention in China, Canadians proved that resilience, perseverance and strength are more than just lofty ideals –they’re commitments that drive our actions and shape our character,” Trudeau said.

Regarding Haiti, Canada is being nudged by the U.S. and other allies to lead an international mission there to deal with the ongoing humanitarian and security crisis. Canada announced on Friday $100 million ($72.7 million U.S.) in new aid for support and equipment for the Haitian National Police.

Haitian Prime Minister Ariel Henry and the country’s Council of Ministers sent an urgent appeal last October calling for “the immediate deployment of a specialized armed force, in sufficient quantity” to stop the crisis caused partly by the “criminal actions of armed gangs.” But more than five months later, no countries have stepped forward. Canada’s top military official has suggested the country doesn’t have the capacity.

Friday's meetings also included discussion of defense spending, an issue that's in the spotlight after the U.S. shot down a Chinese spy balloon that traversed part of Canada and the continental U.S. last month.

Canada has long faced calls to increase its defense spending to 2% of its gross domestic product, the agreed-upon target by NATO members. Ottawa spends about 1.2% now.

"Canada and the United States share responsibility and a commitment to make sure NATO can deter any threat and defend against any aggression from anyone," Biden said. “That’s the bedrock of the security of both our nations.”

The Trudeau government also announced plans for a $7.3 billion project to upgrade and build infrastructure to support the arrival of a new fleet of F-35 fighter jets.