HAYWARD — The city of Hayward will pay $1.5 million to settle a lawsuit filed by the family of an elderly man who died less than two months after a police dog mistakenly attacked him in his own backyard.

A few days after Jesse Porter, 89, was bitten on the left calf by the dog, his leg developed gangrene and was amputated above the knee, said Matthew Davis, a San Francisco attorney who represented Porter’s family. He never returned home, dying in a rehabilitation center less than two months later.

“Mr. Porter was an innocent guy in his own backyard,” Davis said. “He wasn’t suspected of any criminal activity.”

The city contended that Porter was lying unconscious in bushes behind his mobile home, and the dog mistook him for the suspect it was tracking on the night of May 20, 2011.

“The city denies any responsibility for the decedent’s death,” said Michael Lawson, Hayward city attorney. “The city’s position was the dog did exactly as it was trained to. But it’s a difficult case.”

Davis called the city’s version of events “preposterous.” He also said the Dutch shepherd police dog, Nicky, had a history of biting bystanders.

The lawsuit alleged that police violated Porter’s constitutional right against unreasonable search and seizure and used unnecessary force.

The attack occurred while three officers, including Nicky’s handler, Officer Loring Cox, were using the canine to search for a suspect after an armed robbery at a Dominos’ Pizza in west Hayward, according to the lawsuit. The dog tracked the scent to an industrial park, which shares an 8-foot-tall wall with the Hayward Mobile Country Club mobile home park, where Porter lived.

According to the suit, at 10:50 p.m., the officers lifted Nicky over the security wall and instructed the canine to resume tracking the suspect. Porter was in his backyard on the other side of the wall.

“The dog then brutally and relentlessly mauled Mr. Porter, biting his left leg and maintaining the bite while dragging (Porter’s) body across the ground,” the suit says. The dog’s bite left a gaping hole in the calf muscle, the lawsuit said.

The city maintains that Cox was in the yard when Nicky attacked Porter. Cox said he lowered the dog down and then followed, but as he was spooling up the 33-foot leash, Nicky ran to the bushes, according to court documents.

In a deposition, Officer Robert Purnell said he held the end of the leash as Cox lowered Nicky to the other side of the wall, and that no officers had scaled the wall before Cox said, “The dog’s got a bite,” according to court documents.

Davis disputed the city’s claim that Porter was unconscious and lying in the bushes. He cited Purnell’s deposition in which the officer said that, immediately after the attack, he rushed to Porter, who said, “Don’t leave me,” as he grabbed the officer’s arm.

“There’s no evidence to show that he was unconscious,” Davis said.

The elderly man was rushed to Eden Medical Center in Castro Valley and later transferred to a rehabilitation facility, where he died on July 27, 2011.

According to Davis, Nicky had bitten about 30 people before attacking Porter.

“A lot of those people were criminal suspects, but it had bitten two or three innocent bystanders before it bit Mr. Porter,” Davis said. “It was no surprise this dog was going to bite Mr. Porter.”

In early 2011, less than four months before Porter was attacked, Nicky ran past an armed robbery suspect and into a business, where the dog bit a man who had nothing to do with the crime, according to court documents.

Nicky remains on the police force but is not currently “in the field,” said police Lt. Roger Keener. Lawson said the dog’s status is unrelated to the lawsuit.

The city will pay $250,000 of the settlement, with the rest covered by insurance, Lawson said.

Davis said the fact remains that Hayward paid $1.5 million to settle the suit. “The dollars are doing the talking,” he said.