Fire crews were called to free the green truck, which was wedged on its left-hand-side wheels for around an hour under the bridge at Cameron Toll, in Edinburgh.
The driver was not injured in the collision, but police closed the road while investigations were taking place.
A police spokesman said “this sort of thing” had happened a few times.
Rail services were not disrupted and the damage to the bridge was described as “superficial”.
A spokesman for Network Rail said the bridge was on the South Suburban freight line, which does not carry passengers.
The lorry was freed shortly after 3pm and Homebase had arranged for their vehicle to be picked up.