Turning south again it traverses Val Bregaglia at Castasegna and turns east towards Cima di Castello, now forming the northern border of the Valtellina, a territory that was lost by the Three Leagues in 1797 with the formation of the Cisalpine Republic.