Robertson first entered the House of Commons as a Labour MP in 1978, after having won the Hamilton by-election in May of that year, caused by the death of the incumbent Labour MP Alex Wilson in March of that year. He was challenged for the seat by the SNP candidate, Margo MacDonald, who came second. Robertson retained the constituency with an increased majority and obtained 51% of the overall vote. He was re-elected to Parliament at the five subsequent general elections, was Chairman of the Labour Party in Scotland, and was appointed to the Privy Council.