The town takes its name from a castle that once stood on a bridge over the River Maine at the current location of Castlemaine.
In June 1921, an IRA ambush near Castlemaine during the Irish War of Independence resulted in four security-force members being killed.