The device, thought to be a phosphorus bomb, was found in a field about a mile from the main gate of the castle in Angus.
It was dug up by workmen who were widening a road, property manager David Adams said.
The gate was shut and visitors had to be directed to an alternative entrance as police and bomb experts investigated.
The castle, near Forfar, which has royal links dating back to 1372, receives thousands of visitors each year.
Phosphorus bombs were issued to Britain's Home Guard during the war so that volunteers could throw them at invaders.
They were not needed and after the war many were buried.
Mr Adams said: "It's caused a bit of disruption but we have coped well.
"We've had to bring everyone in by a different entrance as the main gate is closed off.