ADAMS COUNTY, Colo. -- A canine with the Adams County Sheriff's Office saved a deputy who was fighting with a suspect, CBS Denver reports.

A sheriff's deputy responded to a trespassing call around 1 a.m. on Saturday. While on the call, a man the deputy was talking to jumped a fence to get away.

The deputy ran after the man -- later identified as 25-year-old Gabriel Steven Garcia -- and became separated from his K-9 officer, a 3-year-old Belgian Malinois named Lex. The two began fighting.

According to the sheriff's office, Lex managed to unlatch a gate with his paw and come to the rescue of his handler. Garcia was subsequently apprehended and charged with attempted first-degree murder and assault in the attack on the deputy.

Get Breaking News Delivered to Your Inbox Click here to view related media. click to expand

On August 6 at 1 a.m., an Adams County deputy responded to a trespass in progress in Shaw Heights. As he was... Posted by Adams County Sheriff's Office, Colorado on Thursday, August 10, 2017

Garcia has been advised of his charges and is being held in lieu of $500,000 bail. He is scheduled to appear in court on Aug. 31, authorities said.

Lex has been with the department since February 2015. He is a certified narcotics and police patrol dog with the Colorado Police Canine Association and National Police Canine Association.