A driver whose flatback truck was carrying a large load thought he could drive under the Amiens Street rail bridge near Connolly Station. But he misjudged the height of the bridge and got stuck.
Rail traffic was immediately stopped between Connolly Station and Tara Street.
Irish Rail engineers rushed to the scene to assess damage.
The incident happened just after 4.15pm yesterday, Irish Rail spokesman Barry Kenny said: "The disruption lasted about 40 minutes."
There was no serious structural damage to the bridge and rail services were running shortly after the vehicle was removed, although some trains were delayed by up to 25 minutes.
Motorists on the M50 northbound were also delayed by a collision close to the Tallaght junction. No one was hurt in the incident.