The Camerons have expressed their thanks for those who cared for Ivan
Gordon Brown has spoken to David Cameron to express his condolences over the loss of his son Ivan.
Mr Brown had already said in Parliament that everyone's thoughts and prayers were with the Conservative leader, but he later spoke to him privately.
Mr Cameron and wife Samantha had issued thanks for the messages of support after the death of six-year-old Ivan, who had cerebral palsy and epilepsy.
Wednesday's Prime Minister's Questions was suspended as a mark of respect.
Leading tributes in the House of Commons, Mr Brown told MPs every child was "precious and irreplaceable" and that the death of a child "was something that no parent should have to bear".
The prime minister, whose daughter Jennifer Jane died aged just 10 days in 2002, added: "I know that in an all too brief life, he brought joy to all those around him and I know also that for all the days of his life, he was surrounded by his family's love."
William Hague, standing in for the Conservative leader, said Ivan - who died at St Mary's Hospital in Paddington, London - had brought "joy and love to those around him".
Mr Hague told MPs that Mr Cameron wanted to pass on the family's thanks for their messages of condolence and say how "hugely grateful" they were to the NHS staff who had helped Ivan throughout his life.
Mr Hague said: "Ivan's six years of life were not easy ones. His parents lived with the knowledge for a long time that he could die young, but this has made their loss no less heart-breaking...
"Ivan suffered much in his short life, but he brought joy and love to those around him".
Deputy Lib Dem leader Vince Cable, standing in for Nick Clegg, urged the family to be given space to "grieve and cope with this tragedy that they've experienced".
MPs from across the political spectrum expressed their condolences to Mr Cameron, who has been leader of the UK's official opposition since 2005.
And Buckingham Palace said the Queen had sent a private message of sympathy.
Shadow Chancellor George Osborne, a close family friend, said although Ivan had often been hospitalised in the past, his death had been sudden, just 45 minutes after being admitted to hospital and had "caused a profound shock and, of course, huge grief".
He added that the Camerons were a "strong" family and that "together they will come through this and treasure the memories they have of Ivan".
Mr Cameron, who has two other children - Nancy, five, and Arthur, three - had been an MP for Witney, in Oxfordshire, for less than a year when Ivan was born in April 2002.
He suffered from Ohtahara syndrome, a very rare form of epilepsy characterised by spasms which start in the first days of life. Some children can suffer as many as 100 seizures every day.
Friends said the experience of caring for Ivan broadened Mr Cameron's political outlook and made him a passionate supporter of the NHS, which helped provide round-the-clock care for Ivan.
The Camerons have asked people to send donations to Mencap or the Friends of St Mary's Hospital rather than send flowers.
Shadow foreign secretary William Hague will stand in for Mr Cameron as Tory leader while he takes time off, it is understood.