He was elected to the post in 1972, but quickly ran into conflict with the governing body, the university court.
In his newly-published memoirs, he recalls how he exercised his right to appoint the outgoing student association president to the court – only for the court to debar him as unsuitable.
“Two High Court judges, both of whom sat on the court, argued it was within their rights to ban anyone they disliked.
“When we took them to the Court of Session it was almost impossible to find a lawyer among the Edinburgh legal establishment who would stand up to the judges by taking my case.
“This was the first time I saw the power of an establishment at work.”
The university was eventually overruled – and they lost again when they tried to remove Gordon Brown as chair of the court.
He writes: “I’m told that Prince Philip, then chancellor of the university and formally consulted on the proposal, sided with me.”
Mr Brown started university at the age of 16 after getting five A-grade Highers.
“The Edinburgh of 1967 was about to cast off its Calvinist past and Edinburgh University would become one of the centres of radical student protest.
It was the age of personal liberation.
“Edinburgh reminded me of what Mark Twain said of his youthful journey from his Presbyterianism home to a frontier town in Nevada, from which he wrote it was no place for a puritan and he did not long remain one.
“The students were in a culture war with Edinburgh’s austere city fathers. Within a few days of starting my studies, the campus newspaper The Student was castigated by the university authorities for featuring a drawing of a nude woman that could be completed by filing in the dots on the page.”
He recalls how the students union demanded that the university’s then rector Malcolm Muggeridge should call for free contraceptive pills to be supplied by the university health service.
Muggeridge refused and used a sermon in St Giles’ Cathedral to denounce the younger generation. “He pronounced that the world was falling apart amid declining moral standards and ended his sermon by dramatically resigning.”
Mr Brown describes his first days at university – moving into his room at Lee House, Pollock Halls, but by the end of the week finding himself in a hospital bed next to elderly cataract patients “in what seemed to be one of the most ancient wards in Edinburgh Royal Infirmary”.
A pre-arranged appointment had led to him being diagnosed with a detached retina after being injured during his last game of rugby before leaving school.
He had an operation and had to lie flat with his eyes bandaged.
“I remember how every night at 9pm a trolley came around the ward offering each patient – thanks to a bequest to the ward – a choice of Guinness, beer or wine, which was open even to a 16-year-old.”
The operation was not a success and he needed another – and then another. “When the third operation did not work I finally accepted I was permanently blind in my left eye.”
In 1971 he realised while playing tennis that he had a problem with his right eye too and was operated on by young eye surgeon Hector Chawla.
“Dr Chawla was about to go on holiday. He delayed his departure and saved my eye. Had I waited even a day in rushing to the Royal Infirmary he would have been gone and I doubt that I would have any sight today.”
His first bid for parliament came in 1979 when he stood in what was then a Tory seat, Edinburgh South.
He had won the selection contest by just one vote – and says it was Nigel Griffiths, later MP for the seat, who had managed to persuade an undecided member to back him.
He increased Labour’s vote by 4000 but still lost by 2460 votes. Mr Brown recalls his friend and Fringe director Alistair Moffat trying to persuade one “very elderly” lady to go and vote. “Alistair said to her in utter frustration ‘But this may be the last time you will ever vote’. She got her coat on and joined us. It was not enough.”
He was elected Labour MP for Dunfermline East at the next general election in 1983 and quickly became a rising star.
But Mr Brown’s life has been touched by great sadness, not least the death in 2002 of his first child, Jennifer, at just ten days old. He writes of his devastation: “The sense of emptiness that came with her loss would not leave me. The day-to-day things that occupy so much of our lives seemed trivial and irrelevant.
“I had been accused of hardly ever smiling, but I doubt if I smiled even once for months after Jennifer’s death. I could not listen to music for more than a year.”
Mr Brown’s wife Sarah gave birth to their first son John the following year. “His arrival was such a joyous event and his presence with us so precious that for months afterwards we could not bear to let him out of our sight.”
Mr Brown writes of his delight when Donald Dewar became Scotland’s first First Minister but says it was “one of my saddest moments” when Mr Dewar died less than 18 months into the job. “I spoke at Donald’s funeral – it was one of the most difficult hours I have lived through.”
He also gave the eulogy at the funeral of former Foreign Secretary Robin Cook at St Giles’ Cathedral in 2005.
The two men had had some turbulent times, but Mr Brown recalls canvassing for Mr Cook in Edinburgh North in the 1970 general election and being a ward organiser for him when he narrowly won Edinburgh Central four years later.
“Robin was seen by me and many others as one of Labour’s brightest and most promising politicians. Friends at the outset and friends at the end, our political relationship was to endure through testing times in between.”
Writing about forming a government after he became Prime Minister in 2007, Mr Brown says: “I would have wanted Robin Cook back in Cabinet and indeed had talked to him about a possible return to office before his untimely death.”