These days, a simple cell phone can make the difference between a conviction and an acquittal.

At least it did for Abdi Sheik-Qasim, who was cleared of assault charges thanks to a video he recorded of the interaction he had last year with two Toronto-based cops.

The best part?

Despite the phone going missing while in police custody, it instantly uploaded a duplicate copy of the 10-second video clip directly to Sheik-Qasim’s email, giving him the proof necessary to clear his name.

“It saved my life, or at least a lot of headaches,” Sheik-Qasim told The Toronto Star, who broke the news last week. “I would have probably been in jail right now.”

The incident took place on Jan. 4, 2014 with officers Piara Dhaliwal and Akin Gul.

Sheik-Qasim, 32, was staying over his uncle’s house in Ontario when law enforcement officials arrived after a noise complaint had been placed by neighbors.  According to The Star, Sheik-Qasim quickly turned down the music’s volume without hesitation and gave the cops his identification.

But when the two police officers insisted on entering his home without a warrant, Sheik-Qasim whipped out his cellphone and began recording the incident, only to have the phone slapped from his hands.

He was then arrested for allegedly assaulting a police officer as well as refusal to comply with a court order.

Both officers testified that Sheik-Qasim was the one who initiated the brawl, alleging he reached for Gul’s utility belt, leaving Dhaliwal no choice but to arrest him.

Nevertheless, Ontario Court Justice Edward Kelly disagreed.

But only after he viewed the video.

Kelly cleared Sheik-Qasim of the bogus charges after viewing the clip and stating he found it “extremely troubling” the cellphone went missing while in police custody.

“The absence of the phone is extremely troubling when considered in light of the testimony of the officers, which I regard to be deliberately misleading,” Kelly said, adding that it must have been nearly impossible for Sheik-Qasim to have reached the utility belt as fast and as aggressively as the cops claim.

“Officer Dhaliwal’s swing of his arm and hand was the very first physical force during the interaction,” Kelly said during trial. “The accused didn’t grab a hold of the belt of Officer Gul in advance of this action by Officer Dhaliwal,” Kelly added.

Sheik-Qasim’s attorney, Alison Craig, said her client will be filing a complaint about the officers’ misconduct on the job.

“My concern is that it happens with far more regularity than is ever uncovered,” Craig said. “If it wasn’t for the video, I think there is a very strong likelihood he would have been convicted.”