Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A Las Vegas police K9 officer was shot and killed Thursday — just three weeks after he returned to duty following a machete attack that had sidelined him for a month.

Nicky, an 8-year-old Belgian Malinois, was killed in the line of duty when his human partner, Sgt. Eric Kerns, was involved in a confrontation with an armed man about noon (2 p.m. ET) Thursday, Las Vegas police Capt. Shawn Andersen said.

Las Vegas K9 officer Nicky, a Belgian Malinois, was severely wounded in an attack by a machete-wielding suspect in February. Las Vegas Metropolitan Police

A dead man and woman were later discovered in a nearby home; police described them as homicide victims. The suspect was shot, as well, and was being treated at University Medical Center of Southern Nevada, Andersen said. His condition wasn't disclosed.

Witnesses told NBC station KSNV that the suspect was randomly shooting at people in the community.

Nicky had returned to duty on March 8, after almost a month recuperating from severe injuries inflicted by a violent suspect wielding a machete, police said.

#Nicky the K9 officer was shot & killed today. He had just returned to work after stabbed w/a machete @News3LV pic.twitter.com/Yy6vCFsKZL — Nathan O'Neal (@NateNews3LV) March 31, 2016

His recovery was widely covered in the Las Vegas area, and he became the center of a fundraising campaign for the police department's K9 unit.

"It's devastating to lose that dog," Andersen told KSNV on Thursday. "That dog is one of us."