In 1989, Janša was involved in the founding of one of the first opposition parties in Slovenia, the Slovenian Democratic Union (SDZ) and became its first vice-president, and later president of the Party Council. Following the first free elections in May 1990 he became the Minister of Defence in Lojze Peterle's cabinet, a position he held during the Slovenian war for independence in June and July 1991. Together with the Minister of Interior Igor Bavčar, Janša was the main organizer of Slovenia's strategy against the Yugoslav People's Army.