Police believe dissident republicans were within minutes of firing four mortar bombs which were found in a van stopped by officers in Londonderry on Sunday night.
The van had its roof cut back to allow the mortars to be fired.
Police believe the target was a Londonderry police station. Three men have been arrested in the operation linked to dissident republicans.
Chief Supt Stephen Cargin said the bombs could have caused mass murder.
Two men, aged 35 and 37, were arrested at the scene at 20:15 GMT on Sunday. One was in the van and the other was riding a motorcycle travelling behind.
A 37-year-old man was arrested later after a house was searched.
It is the first time dissidents have attempted this type of mortar attack.
About 100 families had to leave their homes at Letterkenny Road in the overnight alert.
Chief Superintendent Stephen Cargin said there could have been "mass murder if they had hit the intended targeted.
He said the mortars were "primed and ready to go".
The officer described it as "a reckless attack by dissident republicans to murder police officers in the city of Derry".
"These were people who were mindless, totally reckless, willing to drive four live mortar bombs through a built-up area with no regard to the people, the residents and the families living in the area," he said.
"We believe those devices were destined for one of the police stations here in the city.
"I have no doubt they would have caused mass fatalities. They were on their way to a target. These are crude home-made devices. There is no way the people who planned their attack would have known they would have hit their target."
BBC NI Home Affairs correspondent Vincent Kearney said the discovery of the devices was "a highly significant development".
"Dissident republicans have attempted to use mortars before, but not on this scale," he said.
"A security source said this was 'a major step-up in technical ability - a number of mortars have been recovered in recent years, but not on this scale'."
Northern Ireland's Justice Minister David Ford condemned those behind the bombs.
"They are ruthless, they have no respect for life; they have no respect for the livelihoods of other people," he said.
"They have no respect for the vast civilian population in Derry never mind what may well have been a target."
SDLP MLA Pat Ramsey said: "It is a main cross-border route, one can presume it (the van) was coming from the border. It caused serious disruption for people in the Brandywell," he said.
Mr Ramsey said he watched as a petrol bomb was thrown at police as they tried to help people leave their homes on Sunday evening.
"I was appalled when I saw a petrol bomb getting thrown at a police car. No-one was injured but it was very upsetting," he said.
"Older people and very disabled people have had to be moved from their homes. There was a lady, a double amputee and two disabled people who needed the assistance of an ambulance to get them out.
"This is the distress that the dissidents are causing to their own people in their own communities," he said.
The people who had to leave their homes found shelter in the nearby Brooke Park Activity Centre and the GAA's sports centre at Celtic Park.
Lawrence Moore was one of the residents who had to leave his home. His family stayed with relatives for the night.
"A police Land Rover pulled across the road and we went out to see what was happening.
"We went up to the cordon and could see a white van with its doors open.
"When they moved the barrier back we had to evacuate. When the instructions came we didn't get very long to get ready.
"My son can't go to school today as I didn't have time to get all his things before we left the house."
Sinn Fein MLA Maeve McLaughlin was also on the scene during the alert.
Ms McLaughlin said that "frustration and anger was very apparent in the community".
Northern Ireland Secretary Theresa Villiers said it was a "grim reminder of how severe the terrorist threat continues to be in Northern Ireland".
"The people responsible are small in number and they enjoy virtually no public support at all but they have lethal intent.
"It's only thanks to the highly effective action by the PSNI that we haven't seen a huge tragedy unfolding".
Deputy First Minister Martin McGuinness said: "I want to pay tribute to the PSNI for preventing what could have been a terrible loss of life in an attack which was clearly designed to damage the peace process.
"Increasingly people are providing information which is the proper thing to do so that we can thwart the efforts of those who would try to destroy the peace that has been built up and which is so admired throughout the world."