Kyrgyzstan became a Soviet republic in 1936 and achieved independence in 1991 when the USSR dissolved .