Paraguay achieved its independence from Spain in 1811 .