The town was founded in 1770 under the name Guanajayabo. The name was changed in honour of the independence war leader Máximo Gómez.