TORONTO -- A software engineer working in Canada claims Amazon discriminated against him when a recruiter halted his job application for a position in Toronto when they learned during an interview that he is an Iranian citizen, but the company said they were not legally allowed to hire him.

A few weeks ago, Mohammad Owlia said he received an email from an Amazon recruiter in Seattle asking him to apply for a software engineering position at their Toronto office. The University of Toronto graduate said he completed an online test for the e-commerce giant and the recruiter contacted him again to schedule a phone interview to discuss “HR-related questions.”

On Wednesday evening, Owlia said he was discussing his work experience with the recruiter over the phone when she abruptly brought up his Iranian citizenship.

“It seemed like she was going down my resume and when she reached the University of Tehran, she kind of said ‘Oh I’m so sorry. I didn’t notice that you were an Iranian citizen,’” Owlia told CTVNews.ca during a telephone interview on Thursday.

Owlia said the recruiter then asked him if he had Canadian citizenship or permanent residency. When he responded that he didn’t, he said she told him “We are being instructed not to hire any Iranians.”

The 26-year-old software engineer has been working for a startup company in Toronto for a year and four months after he graduated from a two-year Master’s program at the University of Toronto. He currently has a Post-Graduation Work Permit, which allows him to work anywhere in Canada for three years.

Owlia said he is planning to apply for permanent residency through the Canadian Experience Class route, which requires a year of skilled work experience in the country.

When Owlia told the recruiter he thought it was discriminatory that he wouldn’t be allowed to proceed with the job application because he was Iranian, he said she repeated that it was what she had been instructed to do and that she should have noticed it before the interview.

Owlia said she also told him he could apply again after he had obtained his permanent residency in Canada.

Because the Amazon offices are headquartered in the U.S., the company has a policy to follow U.S. export control laws and regulations, a spokesperson told CTVNews.ca.

Under those laws, companies are not allowed to release software and technology to “Embargoed Country Persons,” which is defined as citizens of Iran, Cuba, North Korea, Sudan and Syria.

These laws are in effect for a company’s offices around the world, though they are permitted to hire candidates from these embargoed countries, provided they hold citizenship, permanent residency, and asylum or refugee status in a non-embargoed country.

“It is Amazon’s policy to comply with U.S. export control laws and regulations,” Amazon’s spokesperson said in a statement. “This policy applies globally to every Amazon business in every country where Amazon operates, including Canada. In keeping with this policy, Amazon employs many Iranians in our offices around the world, but only when we are legally authorized to do so.”

With files from CTVNews.ca Writer Ben Cousins