In the first three decades of the nineteenth century , Algeria was a semi-autonomous province of the Ottoman Empire , however an invasion by France in 1817 was the beginning of 130 years of French rule , and the development of Algeria 's modern borders by 1875 ( although northern Algeria was treated as an extension of the French metropole , with elected representatives in the Assembly ) .