A man who allegedly fired shots into an Indianapolis police officer's home as his wife and child slept screamed obscenities against police during and after the attack and was once arrested by that officer, the city's police chief said Tuesday.

Chief Troy Riggs said the officer's wife and child were asleep inside and the officer was awake after working a night shift when at least five bullets struck his home about 2:30 a.m. Tuesday. One of those bullets struck a window near where the officer was sitting inside, he said.

The officer and his family were not injured in the shooting, which also left the officer's patrol car with at least three bullet holes, the chief said.

Riggs said he was "deeply troubled" by the shooting of the officer's home, coming after last Thursday's fatal shootings of five Dallas police officers who were standing guard as hundreds of people peacefully protested the killings of black men in Louisiana and Minnesota.

"This is your home. If there is one place in the world you should always feel safe, your family should feel safe, it's in your home. And somebody violated that this morning," Riggs said during an afternoon news conference.

"This is just another realization that police work is dangerous. We know that when we sign up for this job, but it's just unfortunate this officer's family had to endure this attack last night."

The chief credited neighbors with providing information that helped officers track down the shooting suspect, who was taken into custody but had not been charged as of late Tuesday afternoon.

Peg McLeish, a spokeswoman for the Marion County Prosecutor's office, said the case remains under investigation and the suspect will not be charged until Tuesday at the earliest.

Online records show the suspect, a 27-year-old with a lengthy criminal record, was released from prison in June after serving a 5-year sentence for unlawful possession of a firearm by a serious felon.

Riggs said the officer whose home was targeted had arrested the suspect on a weapons charge eight years ago, but the investigation into the suspect's motive in the attack is ongoing.

When the suspect was taken in for questioning he yelled obscenities against police once again and then intentionally urinated against the walls in the interview room, he said.

Riggs said the man was wearing a T-shirt with an obscenity directed at police on its front and "Black Lives Matter" on the back. But the chief was quick to say the man's actions shouldn't reflect on the "Black Lives Matter" movement, including weekend protests in Indianapolis against police shootings of blacks.

The Indianapolis officer whose house was targeted is white and a 10-year department veteran, while the shooting suspect is black.

"We cannot let the actions of one individual represent an entire group of citizens that utilized their First Amendment rights peacefully over the weekend to protest here in Indianapolis," Riggs said.

He added that people protesting against police should not "let the actions of a few officers tarnish the good, dedicated and honorable work" the city's police officers perform every day.

In the wake of the shooting, the Indianapolis Metropolitan Police Department sent a memo to its 1,640 officers Tuesday as well as its civilian employees advising them to have emergency plans in place for their homes and their families.

"It's a reminder to be prepared," said Patrolman Jim Gillespie, a department spokesman. "Basically it says we've got to be vigilant and make sure we have a plan in place for our family in case another incident occurs."