First-order phase transition in a model for earthquakes.