A California software developer has published a viral blog post recounting his experience of being fired by a machine – and how his bosses were powerless to stop it.

Ibrahim Diallo had been working at a Los Angeles company for just eight months of his three-year contract when his key card stopped working – and he had to rely on the security guard to allow him entry.

"It wasn't the first time my key card failed, I assumed it was time to replace it,” Diallo wrote in his blog post. "As soon as I got to my floor, I went to see my manager to let her know. She promised to order me a new one right away."

Egyptian-born Diallo then noticed that he had been logged out of his work system and that the word 'inactive' was listed alongside his name.

That same day, he was told by his recruiter that she had received an automated email from the work system to say his contract had been terminated.

However, he was reassured by his director that the problem would be resolved and he was given the green light to come into work the following day.

The next day he had been locked out of almost every single system. Later that afternoon, two security guards escorted him out of the building after they’d received a “very threatening email” ordering them to do so.

We’re on a nationwide quest to find 51 Artificial Intelligence Innovators for an upcoming list in the next edition of our magazine

NOMINATE AI INNOVATORS NOW

He wrote: "I was fired. There was nothing my manager could do about it. There was nothing the director could do about it. They stood powerless as I packed my stuff and left the building.

"The system was out for blood and I was its very first victim."

The problem was eventually resolved after three weeks and Diallo found out why he was terminated in the first place.

Just before he was hired on a three-year contract, the company was acquired by a larger organisation and he joined during this transition.

His previous manager had been laid off as a full-time employee and was told to work from home as a contractor for the duration of his contract.

"I imagine due to the shock and frustration, he decided not to do much work after that,” Diallo wrote. “Some of that work included renewing my contract in the new system.

"When my contract expired, the machine took over and fired me.”

According to the software developer, he missed three weeks of pay because no one could stop the machine. Although he was back at work, he eventually decided to take a new job.

"Automation can be an asset to a company, but there needs to be a way for humans to take over if the machine makes a mistake," he said.