Most likely source is like Andrew said, a bad connection between the cable and the speedo.
The less likely, and need to send it out for repair, is the magnetic bell inside the gauge is rubbing or out of alignment. Not a home repair for 99% of us. But a good speedo shop can do it.
My oil line fix
My 100k stopped odometer fix
Brace for impact, I'm in a "modifying mood". Massive thread count inbound.