Macedonia gained its independence peacefully from Yugoslavia in 1991 .