Pakistan native Tayyab Shabab is described as a "world class talent" and has a steady job as an app developer in Sweden, but last year he had an application for a work permit extension rejected by the Swedish Migration Agency (Migrationsverket) because a previous employer forgot to take out occupational pension insurance for him.
The fight to prevent his deportation was backed by huge names in the tech world including Spotify founder Daniel Ek, and also provoked an online petition signed by more than 10,000 people including The Local's CEO Paul Rapacioli. With the help of non-profit organization Centre for Justice, Shabab launched an appeal against Migrationsverket's decision.
On Tuesday however, the Migration Court in Stockholm delivered its judgment that Shabab and his wife should be deported from Sweden on the grounds of the error his previous employer made.
"I heard the decision from my lawyer today and felt really sad, I'm really disappointed now," he told The Local.
"I was quite optimistic and didn't expect it. Things were moving in a positive direction, there was a lot of media hype, the government was even proposing new rules, so I thought that seeing as it was all going in a positive direction I'd get a positive decision from the court. I wasn't expecting it at all."
The court was split in its decision: two of the four members assessed that Shabab should be allowed to stay in Sweden, but as a result the final say was decided by the chair of the court, who agreed with Migrationsverket's interpretation of the rules.
The developer has now been told that he has four weeks to leave Sweden unless he decides to appeal the decision further to the highest migration court in Sweden, the Migration Court of Appeal (Migrationsöverdomstolen).
"There's the possibility of appealing higher in three weeks. I don't know about it yet though because I have to discuss it with my lawyer and my company, then we'll decide," he explained.
Shabab has lived in Sweden since 2013. He moved to the Nordic country to do a masters degree in computer science before going on to work in the tech industry. His previous employer made an admin error when trying to take out occupational pension insurance for him, based on which Migrationsverket said he could not be granted a new visa last year.
That is despite his employer at the time offering to correct the mistake by paying for the necessary insurance in retrospect. His current employer, Dynamo, has always insisted that he is a top talent within his field.
"A lot of people have spoken to me, and there's been a lot of support from colleagues, friends and the media. I don't know why the court still thinks it's my mistake and I should be rejected. That's crazy, to me. I don't feel good at all right now," he sighed.
"In the last few months a lot of people have contacted me who are going through the same problems. There are a lot of problems for small startups – new companies sometimes don't know the exact rules for international people."
Debate about Sweden's overzealous interpretation of work permit rules and deportations on the grounds of small errors grew so strong at the end of 2016 that the government is currently considering changing them after being told by a parliamentary committee to do so.