PACIFICA — A man was shot and killed by officers Tuesday evening after he stabbed a SWAT team member as the squad rushed into a San Pedro Avenue home following a six-hour standoff that started when family members reported the suspect acting erratically shortly before noon, police said.

Pacifica police were called to the 300 block of San Pedro Avenue when family members said the 34-year-old man was in the backyard exhibiting paranoid behavior, possibly armed with an ax.

Arriving officers found the man, who would not obey commands from police and brandished the ax at them. They tried to take him into custody but the man ran into his home and barricaded himself inside, police said.

Police learned that the holed-up man may have had access to a rifle and ammunition that was hidden in the house, and surrounding homes were evacuated as a precaution. Police tried to communicate with the man, at one point throwing a phone into the residence for him to pick up as well as talking through a public address system.

They got no response. By this time, Pacifica police had been joined by the Daly City SWAT team.

After unsuccessfully using unspecified “distraction devices” to try and get the man out of the house, officers went in, which is when one was stabbed by the suspect, who had armed himself with a knife.

“In defense of the injured SWAT member the suspect was fired upon and was determined deceased at the scene,” according to a police news release.

The injured officer was taken to a hospital for treatment with wounds that are not considered life-threatening.

No additional information was available late Tuesday, and the matter is under investigation by Pacifica and Daly City police as well as the San Mateo County District Attorney’s Office.

Contact Eric Kurhi at 408-920-5852. Follow him at Twitter.com/erickurhi.