After the Carnation Revolution of 25 April 1974, Sampaio founded the Movimento de Esquerda Socialista (MES) (Portuguese acronym for Socialist Left Movement) but abandoned the political project soon after. In 1978 he joined the Socialist Party, where he has been associated with the party's left wing. He was first elected to Parliament as a deputy for Lisbon in 1979. Between 1979 and 1984 he was a member of the European Commission for Human Rights, where he developed important work on these topics. Between 1986 and 1987 he was president of the parliamentary bench of the Socialist Party. In 1989 he was elected president of this political group, an office he held until 1991. Also in 1989, Sampaio was elected the 62nd Mayor of Lisbon, a charge he took in 1990, and was re-elected in 1993, remaining in office until 1995.