PALMDALE, Calif. — In what officials called an "extremely unfortunate incident," California sheriff's deputies shot and killed a teenage boy while trying to stop a charging dog.

The deputies opened fire when a pit bull charged at them a second time early Thursday in the Southern California city of Palmdale, according to the Los Angeles County Sheriff's Department.

Deputies initially responded to a noise complaint around 3:45 a.m., according to sheriff's Capt. Christopher Bergner. Authorities had been to the location, in a single-story apartment complex, four times in the past two months in reference to loud music or gang-related calls, he said.

The deputies were approaching the driveway when an approximately 60- to 65-pound adult male pit bull charged and bit one of them on the left knee, Bergner said at a late morning news conference held at the scene of the shooting, according to PIX11 sister station KTLA.

At that point, a teen came out and apparently tried to restrain the dog. According to the Los Angeles Times, which cited a copy of an internal sheriff's memo it obtained, the 17-year-old boy owned the dog.

However, his aunt later said that the dog didn't belong to him.

While the teen tried to corral the animal, the deputies retreated to request medical assistance and to call for back up.

But as they waited for other responders to arrive, the pit bull charged the deputies a second time, prompting both of them to open fire, according to Bergner. In total, six to eight rounds were fired.

The shooting prompted the animal to retreat, and deputies regrouped as they tried to formulate a plan to capture the dog, so that no one else would be victimized by the animal, the captain said.

As they did so, the deputies came across the juvenile, who was down with a gunshot wound to the upper torso.

He was rushed to a hospital where he was later pronounced dead.

Officials have not formally released the name of the teen, but his aunt identified him as Armando Garcia.

"How can he be portrayed as a bad person," Amber Alcantar said of her 17-year-old nephew, her voice choked with emotion.

She said her nephew lost his life trying to save a friend's dog.

"From what I hear, they had already shot the dog," Alcantar told KTLA. "So why did they keep shooting?"

Garcia may have been hit by a "skip" round that ricocheted off the driveway while walking around the apartment building; he was approximately 40 feet away from the deputies at the time of the shooting, Bergner said.

Preliminary information indicated the deputies didn't see the teen when he walked around the building, according to Bergner.

"It is what we're calling an extremely, extremely unfortunate incident at this time," he said.

The deputy who had been bitten was also struck by a "skip" round in his right knee and was taken to a local hospital. He was treated and has since been released.

Authorities said the dog was hit by the gunfire but survived the shooting, the Times reported. Lolita Robinson, the dog's owner, later confirmed to KTLA that he died.

According to an internal sheriff's memo, the deputies shot at the pit bull “while the dog owner simultaneously tried to jump onto the dog to stop it from attacking deputy personnel.”

Robinson, whose daughter lives in the apartment complex near where the shooting happened, told KTLA she never witnessed the dog being aggressive.

“The dog was not aggressive," she said. "I watched the dog grow up, that’s a puppy. It grew up around my grandkids. He’s not aggressive at all, so I’m not understanding why they’re saying he was aggressive and bit an officer.”

Multiple agencies were investigating the fatal shooting, including the L.A. County Department of Medical Examiner-Coroner, the sheriff's Homicide Bureau and Internal Affair Bureau.

Anyone with information about the incident is asked to call 323-890-5500. Those who would like to remain anonymous can leave a tip with "Crime Stoppers" by dialing 800-222-8477.