Liam Fox, Conservative shadow defence secretary, displayed homophobic credentials whilst at university, an investigation by the Sunday Herald has found.

The Tory MP, who stood against David Cameron in the 2005 Conservative Party leadership content, resigned as a member of the University of Glasgow’s student council in protest at a gay and lesbian society being admitted to the Glasgow University Union (GUU).

He apparently said at the time: “[I do] not want the gays flaunting it in front of me, which is what they would do”.

His stance was echoed by the then union president, Vince Gallagher, who said:

“We just do not want poofs in our union. I wish they would just bugger off and give us peace.”

Eventually the homophobic rhetoric of the president was condemned by the Student Representative Council (SRC), but this led to the resignation of Mr Fox.

He told the student newspaper: “I think it is obvious that the GUU speaks for the vast majority of students on campus.

“The SRC is totally unrepresentative and speaks only for minorities. I feel they are becoming a tool for the QM Queen Margaret Union.

“I’m actually quite liberal when it comes to sexual matters. I just don’t want the gays flaunting it in front of me, which is what they would do.”

In an interview in 2005, rumours of a gay past led to to Mr Fox saying: “I know that some people use smears and I have heard them for years. They’d say, Why are you not married? You must be a playboy or a wild man or gay,’ or whatever.

“Well, I’m getting married in December and I’m perfectly happy with my private life.”

Gay rights campaigner Peter Tatchell told the newspaper:

“This homophobic stance, while a student, seems to be part of a pattern of anti-gay prejudice that has continued right up until recent years.

“I am ready to forgive him and move on, but only if he makes a clear public statement expressing regret for his past homophobia.”

Fox yesterday said: “Fortunately most of us have progressed from the days when we were students more than a quarter of a century ago.”