The SNP veteran - among the first elected to the new Scottish Parliament in 1999 - said it had been a great privilege to serve.