The suspect in the Nottingham knife and van rampage was caught on CCTV skulking around outside a hostel prior to one of the killings.
Footage shows a man apparently looking for a way into Seely Hirst House - which provides accommodation for vulnerable and homeless people in the city.
Witnesses said he was seen trying to climb in an open window but a resident woke up and punched him, sending him stumbling back to the ground, before he made off.
The man was spotted arriving at the property in Mapperley Road just after 4am - minutes after university students Barnaby Webber and Grace Kumar, both 19, were stabbed to death.
It was before third victim Ian Coates, thought to be 65, was murdered and his van stolen.
Evicted family seeking help 'stranded' inside council office after staff go homeA resident told the Telegraph: “He tried to get into my ground floor room, through the window.”
They told Sky News: "Thank god I woke up as I might have been dead."
Alex Pridmore, a trustee of All Saints Homeless Shelter, which runs Seely Hirst House, said: “We don’t know why he chose to come here. He hasn’t stayed here in the past.
“Nobody was harmed but our residents are already vulnerable and something like this leaves them very shaken.
“We are working closely with the police and assisting their enquiries into this horrific incident.”
He added: “There are staff on site 24/7.
“After he was alerted by the resident, the staff member went outside.
“He basically observed what the guy was doing until he left after a few minutes.”
A male member of staff at the care home monitored the man seen near the window until he had left the property.
Police officers later attended the hostel and spoke to those housed there, as well as staff about the attempted entry.
It is thought the suspect made his way from Ilkeston Road, where Barnaby and Grace were found at 4am to Mapperley Road.
School caretaker Ian was then found on Magdala Road.
Meet the Labour candidate hoping to oust Boris Johnson at the next electionHe is thought to have been attacked around 5am outside Magdala Tennis Club.
His van was allegedly driven by the suspect to the city centre where three people were rammed at a bus stop on Milton Street.
There are reports the suspect may have used an electric scooter or e-bike to move along part of his route.
Video shows a man being detained on the street next to a van, with witnesses saying he was tasered.
Nottinghamshire Police have confirmed they are not looking for anyone else in connection with the incident.
In a statement, referring to the hostel incident, the force said: “It is known that a man attacked two University of Nottingham students with a knife on Ilkeston Road on Tuesday 13 June.
“A call was made to police at 4.04am. Police quickly attended and found a male and female student, aged 19, in the street unresponsive.
“Investigations have then revealed that a man matching the description of the suspect had attempted to gain entry to a supported living complex in Mapperley Road but had been denied entry.
“This incident was not reported to the police at the time.
“Police believe the suspect has then attacked a man and stolen his van.”