Tribute was paid to "the greatest parliamentarian of our time" as hundreds gathered for the funeral of former foreign secretary Robin Cook.
Family, friends and senior politicians attended the service for the Livingston MP at St Giles Cathedral in Edinburgh.
Chancellor Gordon Brown said his Labour colleague's death had left a gap "which can never be properly filled".
Mr Cook died last weekend at the age of 59 after falling ill while walking in the Scottish hills.
The mourners were led by Mr Cook's wife Gaynor and his sons from his first marriage, Peter and Christopher. His ex-wife Margaret attended with partner Robin Howie.
His election agent Jim Devine, a close personal friend and the best man at his second wedding, greeted mourners.
Delivering the principal tribute to Mr Cook, the chancellor said his colleague was "taken from us at the height of his powers".
"His mission and his achievement was not just to make great speeches but to advance great causes - and he did.
"This is how I believe we best remember Robin, not just for what he said and how he said it but what he stood for - the greatest parliamentarian of our time, who put all his talents and his life at the service of the greatest causes of our time.
"Whenever there was injustice he sought to right it, wherever there was poverty he fought a war against it."
Readings were also given by Mr Cook's children, Glasgow MP Mohammad Sarwar and racing pundit John McCririck.
He attacked Prime Minister Tony Blair, who is abroad on holiday and did not attend the service, for delivering a "snub" to the Cook family.
He said his decision "demonstrates a petty vindictiveness and a moral failure, opting to continue snorkelling instead of doing his duty".
However, Mr Devine responded: "John McCririck was wrong to say those things. It is not what Robin would have wanted."
The service was led by the Right Reverend Richard Holloway, former Primus of the Scottish Episcopal Church.
He told mourners that as an avowed atheist Mr Cook would have raised a "quizzical eyebrow" at the service being held in St Giles Cathedral.
But he said it was an "entirely appropriate" venue because, like late First Minister Donald Dewar, Mr Cook was "a Presbyterian atheist".
And he added: "This historic cathedral is not just the home of a Christian church, it is an important place in the civic and community life of Scotland.
"So it is entirely fitting that it is where we meet to give thanks for one of Scotland's greatest sons and in which to express our feeling of sorrow and loss at his untimely death."
Christopher Cook read from his father's political memoir The Point Of Departure, while his brother Peter chose a passage from Germinal by Emile Zola - one of his father's favourite books.
The service also featured a recital by traditional musicians Aly Bain and Phil Cunningham.
Robin Cook took ill while hillwalking
Floral tributes were placed outside the doors of the cathedral on the city's Royal Mile.
The square next to St Giles is usually bustling with festival performers, but was cleared of entertainers for the funeral.
Many people stood behind crowd barriers to watch mourners arrive and then listen to the service on a loudspeaker.
After the service the funeral cortege left for a local cemetery and a private burial.
Mr Cook collapsed while hillwalking in the Scottish Highlands last weekend.
He was pronounced dead in hospital after he fell eight feet down a ridge, near the summit of 2,365ft Ben Stack.
A post-mortem examination concluded that he died from hypertensive heart disease.