Armenia was one of the six Soviet republics (the Baltic states, Georgia and Moldova included) who participated in a boycott against a nationwide referendum which eventually led to the reformation of the Soviet Union into its current form as the Union of Soviet Sovereign Republics. The region followed suit with the Baltic states and declared independence from the Soviet Union on August 23, 1990.
Armenia and the Soviet Union eventually came into conflict over the status of the Nagorno-Karabakh Autonomous Oblast (which Azerbaijan had attempted to abolish). The oblast had a majority population that was Armenian and had a movement aimed towards uniting the region with Armenia. Eventually a compromise was reached before the situation could escalate to war. In exchange for remaining part of the Soviet Union, Nagorno-Karabakh would be upgraded to Republic status (eventually renaming itself to Artsakh) as well as Armenians being free to travel along the Azerbaijan border. The compromise also led to the creation of the Collective Security Treaty Organization between Armenia and the Soviet Union as well as allowing Armenia to remain in a currency union with the USSR.