During the communist period, Kaczyński was an activist in the pro-democratic anti-communist movement in Poland, the Workers' Defence Committee, as well as the Independent Trade Union movement. In August 1980, he became an adviser to the Inter-Enterprise Strike Committee in the Gdańsk Shipyard and the Solidarity movement. After the communists imposed martial law in December 1981, he was interned as an "anti-socialist element". After his release, he returned to trade union activities, becoming a member of the underground Solidarity. When Solidarity was legalized again in the late 1980s, Kaczyński was an active adviser to Lech Wałęsa and his Solidarity Citizens' Committee in 1988.