After promising to search North America for the perfect home for its next headquarters, Amazon has narrowed its list to 20 cities — 19 of which are in the United States. The one exception? Toronto.

An outlier on Amazon's list, Toronto has earned the attention of the technology world due to its diverse population, talent pool and welcome stance on immigration.

"It's got this incredible aspiration for inclusivity," Dan Doctoroff, CEO of Sidewalk Labs, the urban innovation arm of Google's parent company which is developing a Toronto neighborhood, said at an event Wednesday. "If Amazon sees what we see here, it won't even be a close call."

Toronto is the fourth largest city by population in North America, with 2.8 million people. Its percentage of foreign-born residents in the region — 39.7% — exceeds every other city on Amazon's list. Its population has grown by more than 400,000 people in the last five years.

Toronto's appeal to the tech sector, which relies on foreign workers, has grown amid diverging stances on immigration from the U.S. and Canadian governments. Last year, Canada launched a program to process work permits and visa applications for skilled workers within two weeks.

Three Amazon finalists are inside the Beltway. What gives?

The Trump administration has moved to tighten access to H-1B visas, a popular route to tech jobs for foreign workers. Its 2017 travel ban for six majority-Muslim countries also rattled the tech industry, triggering foreigners to give more serious consideration to education and work outside the U.S.

"The more inclusive we are, the more we will win against communities that are trying to exclude any group of talent," Karen Greve Young, vice president of corporate development and partnerships at Mars, a Toronto organization that supports startups, told CNN Tech.

In 2017, the University of Toronto's computer science program saw a 50% increase in graduate school applicants, according to its director of professional programs, Matt Medland.

The university is also home to a superstar in the world of artificial intelligence, professor Geoffrey Hinton. Tech giants such as Google and Amazon see artificial intelligence as essential to the future of their companies.

Related: Google's parent company to build futuristic neighborhood in Toronto

In its bid to host Amazon's second headquarters, Toronto promised to boost the number of the students graduating with STEM degrees. Toby Lennox, CEO of Toronto Global, which organized Toronto's submission, believes talent is why Toronto was the only non-U.S. city to make Amazon's list.

"We're able to meet their needs across the board," Lennox said. "Once you match that with an immigration system and an education system that is so welcoming, it makes for large employers a real opportunity."

Lennox said he heard from a company interested in Toronto because it needed workers who could speak four different Portuguese dialects.

"We've just made the playoffs," Toronto Mayor John Tory told CNN Tech. "But it's a long way to the prize."