Professor John Curtice, of Strathclyde University, who was giving evidence on plans to legalise same-sex marriage, revealed that in the 1980s public attitudes to homosexuality were very conservative and actually became less tolerant during that decade as the AIDS crisis worsened.
In the British Social Attitudes (BSA) survey in 1983, 62% of respondents said same-sex relationships were "always" or "mostly" wrong, compared with 21% who saw this as "rarely" or "not at all wrong" and by 1987, those registering disapproval had risen to 74%.
But in a submission to Holyrood, Professor Curtice charted "one of the most marked changes in attitudes to have been identified by the BSA", writing: "Attitudes have gradually but consistently become more liberal.
"In 2003, shortly before the introduction of civil partnerships for same-sex couples, the proportion who felt that same relations were rarely or not all wrong outnumbered those who felt that they were always or mostly wrong for the first time.
"Thereafter, attitudes have become yet more liberal such that, according to the most recent reading, taken in 2012, as many as 57% now say that same relations are rarely or not all wrong, while just 28% feel that they are always or mostly wrong.
"The balance of opinion on the subject is now almost a mirror image of what it was 30 years ago."
Professor Curtice said a more liberal attitude to sexual mores extended not just to homosexuality but to unmarried couples living together and having children, and to abortion.
He said the exception was the view of infidelity in relationships, which had hardened in disapproval.