A mortar bomb was fired at Strand Road police station in Londonderry in the early hours of Saturday morning.
Police said they believe it was launched from the rear of a red Vauxhall Cavalier car that was parked in Queen Street at about 0015 BST.
The device struck a wall but did not explode. Police are investigating a link with dissident republicans.
A Fold for the elderly and a number of other houses were evacuated as a precaution. No-one was injured.
It is understood the device partially exploded inside the car which was found on fire. A bomb disposal team later carried out a controlled explosion.
Detectives are appealing for anyone who was in the Queen Street or Asylum Road areas at the time or anyone with information on the movements of the red coloured Vauxhall Cavalier car in the area to contact them.
Chief Superintendent Stephen Martin, District Commander, has condemned those who were behind the attack.
"Attacks such as this are an attack on the local community and the good people of Derry, this incident resulted in local people, including the elderly residents of a nearby Fold, being evacuated for a considerable time.
"Had this device exploded when it struck the station wall or veered off course, innocent people in the immediate area could have been killed or seriously injured. Thankfully that is not the case."
Justice Minister David Ford said: "Thankfully no-one was hurt in what was a senseless attack."
He added: "Those who carried this out refuse to accept the will of the vast majority of people across this island. They will not succeed."
Sinn Fein councillor Gerry MacLochlainn blamed dissident republicans for the attack.
"I would call on those who support these groups to come forward and explain to the people of Derry how this act will in any way advance republican objectives.
"People in Derry do not support these actions and will be angered at the disruption that this brought to the local community.
"It also disrupted the night time economy of the city centre and continues to cause massive disruption in the city today."
SDLP councillor Helen Quigley said "This experience has been extremely traumatic for these old and vulnerable people, many of whom have been denied access to necessary medication.
"A number of young people living in nearby flats have also been subjected to a great deal of anxiety having been evacuated and moved to Brooke Park Leisure Centre during the night."
Viable pipe bomb
Meanwhile, police said another suspicious object found in a bar in Derry on Friday evening was a viable pipe bomb.
The alarm was raised after the device was found upstairs in a bar at Stanley's Walk, in the Brandywell area.
The Army dealt with the device and the alert has ended.
In a separate alert in the Ballymagroarty area early on Friday, five homes were evacuated.
A suspicious device left at the roadside at O'Connor Court turned out to be a hoax.
Two controlled explosions were carried out shortly after 0500 BST.