The Republic of Latvia declared the end of the transitional period and restored full independence on 21 August 1991, in the aftermath of the failed Soviet coup attempt. Latvia resumed diplomatic relations with Western states, including Sweden.  The Saeima, Latvia's parliament, was again elected in 1993. Russia ended its military presence by completing its troop withdrawal in 1994 and shutting down the Skrunda-1 radar station in 1998. The major goals of Latvia in the 1990s, to join NATO and the European Union, were achieved in 2004. The NATO Summit 2006 was held in Riga. Vaira Vīķe-Freiberga was President of Latvia from 1999 until 2007. She was the first female head of state in the former Soviet block state and was active in Latvia joining both NATO and the European Union in 2004.