The suspect was not struck by gunfire, yet suffered minor injuries, the Sheriff's Department said in a statement. He was treated at an area hospital and later booked at the sheriff's Palmdale station.
No deputies were injured.
Deputies were called to the 38200 block of Pioneer Drive at about 9:30 p.m. Saturday regarding an assault-with-a-deadly-weapon call, where shots were heard inside the location.
Deputies arriving at the scene were told by a witness that a suspect was inside armed with a handgun. They gave the suspect commands to leave the residence.
Video showing LA County deputies punching man in Palmdale prompts investigation
"A short time later, the suspect appears at an upstairs bedroom window armed with a handgun,'' sheriff's officials said. "It's believed the suspect fired his handgun at the deputies and a deputy-involved shooting occurred."
The deputies then gave more commands for the suspect to leave the home. After several minutes, the suspect exited the home without further incident and was taken into custody. A handgun possessed by the suspect was recovered at the scene, authorities said.
Anyone with information about the incident is urged to call the sheriff's Homicide Bureau at (323) 890-5500.