During the Middle Ages, numerous clashes between the Guelphs and Ghibellines took place in this region. The Guelphs supported the power of the Bishop of Brescia and the papacy, while the Ghibellines sided with the Holy Roman Emperor. In 1287 the Val Camonica rebelled against control by Brescia and sided with the Visconti, lords of Milan, who extended their control over the area during the 14th century. From 1427 to 1454 there were numerous battles between Milan and the Republic of Venice for the control of the valley. Ultimately the valley came under the control of Venice. During the following centuries, the civilian population grew and engaged in the iron trade.