SUNNYVALE — Police fatally shot a man who reportedly charged at officers with a knife at an apartment complex early Thursday afternoon, according to the Sunnyvale Department of Public Safety.

Officers were called just after noon to the Palms Villa Apartments in the 1200 block of Ayala Drive after a woman called to report anattack, Sunnyvale Capt. Jeffrey Hunter said.

Hunter said the officers were confronted by a man carrying a knife, who soon charged at them. Three officers opened fire at close range, wounding the man. He was taken to the hospital, where he was pronounced dead.

No officers were injured. Hunter later confirmed that the man who was shot and the woman who called police are related and said the initial call to police was “related to a sexual assault that occurred between the two.”.

A nearby resident told this newspaper that around noon, neighbors heard a burst of four to five gunshots in “very quick succession,” with some initially thinking it might have been firecrackers because of the rapidness of the sounds. No other gunfire was heard.

The resident, who asked not to be named out of privacy concerns, said that it was at least half an hour after the shots were heard that they saw a large man being carried away from the scene on a gurney, as police and emergency personnel performed CPR and other live-saving measures.

Some neighbors reported hearing a loud argument before the shooting, but it was not clear whether it was related to the police encounter.

The resident also said no evacuations were ordered and that the mood of the crime scene suggested that there was no further threat to either police or the public.

The shooting marked Sunnyvale’s fourth officer-involved shooting of the year, three of which were fatal. Three of the shootings involved Sunnyvale police and the fourth involved Santa Clara police.

This was also the third office-involved shooting in the Bay Area this week. On Monday, San Jose police officers shot and killed a man who had held a woman hostage at a home in the Cambrian Park neighborhood. On Wednesday, San Francisco police shot and killed a man who had climbed to the top of a construction site adjacent to St. Luke’s Hospital with a loaded shotgun and fired at least one shot to the street below. All three officer-involved shootings this week have been fatal.

Staff writer Katie Nelson contributed to this report.