The city of Ciego de Ávila was founded by 1840, having at the time 263 inhabitants. In 1877, its municipal government was created and the city became independent of the city of Morón. Ciego de Ávila gained importance when the Spanish army built a fortified military line, known as Trocha de Júcaro a Morón, to impede the pass of insurrectionist forces to the western part of the island during the 1st War of Independence (1868–1878). This "trocha", which made this region famous, was thought to be strong enough to stop the Cuban forces, but was not able to stop the pass of General Máximo Gómez and several hundred men. Many of the old Spanish colonial buildings in Ciego de Ávila (such as the Teatro Principal) were commissioned under Angela Hernández, viuda de Jiménez, a rich socialite who battled to create a cultural mecca in her hometown.