Burglars initially evaded suspicion when sneaking onto the grounds at Harcourt Square, the force’s nerve centre of operations.
It is understood at least one of the men climbed over low railings around Block 4 of the complex where maintenance work was going on.
He moved undetected around the exterior basement area of the four-storey building, eventually reaching an area around Block 3.
It was while one of the robbers tried to enter this part of the building through a window at around 9.45pm on Monday night that a detective raised the alarm.
He quickly called for back-up and both men were apprehended and a car was searched and seized nearby.
Reports of attempts to tamper with garda cars were ruled out.
Gardaí dismissed media reports that the men were trying to plant a bomb under a garda’s car.
Sources said that one of the men was arrested near a car, not underneath one, and the other was apprehended on the street outside the headquarters.
One garda source said gardaí were “scratching their heads” as to the motives behind the robbery.
“It’s a huge building. You’d get lost in there even after years working in the building,” said one source.
“You would have to know exactly where you were going. We’re a bit at a loss to explain it, but there is a bit of concern because it’s so close to home.”
Both men are well known to detectives.
Command and Control at the headquarters is the nerve centre of garda operations in the Dublin Metropolitan Region.
Gardaí fear the men may have been attempting to steal sensitive evidence.
Garda headquarters houses some of the force’s top personnel, among which are Special Branch gardaí and detectives with the National Bureau of Criminal Investigation.
In addition, Harcourt Square is where a new crime unit was recently set up to target organised crime.
Following the upsurge in gang killings last year, Commissioner Noel Conroy brought together a dedicated anti-gang unit there.
The new task force is attached to the National Bureau of Criminal Investigation and is headed up by Chief Superintendent Noel White.
Security was visibly stepped up outside Harcourt Square yesterday.
The attempted break-in at garda headquarters comes after a hoax pipe-bomb was planted under a car at a garda’s home in west Dublin just a few weeks ago.