When David Cameron strode into the Royal Horticultural Hall in Westminster on a bright morning in June last year to deliver a speech on the environment, his audience had no idea of his private anguish.

The smile was there, so was the fluent delivery - his manner gave no hint that he had spent the previous night sleeping by his son's side on the floor of St Mary's hospital in Paddington, west London. Ivan had suffered one of his regular seizures the evening before; his father had stayed by his side after rushing him to hospital.

In the pressure cooker of Westminster, where the daily battle can dehumanise politicians, it was often easy to lose sight of the burden on Cameron and his wife Samantha. Friends say they were always by Ivan's side when he was rushed to hospital because they feared he might not return. "Ivan had close shaves before, it was often touch and go," one friend said. "Dave and Sam were living with constant uncertainty. They were haunted by the danger."

In his six short years Ivan had a profound impact on his father, mother and their extended family. In turn Ivan may have helped to shape British political life if his father makes it to Downing Street.

In the mid-1990s Cameron was still a sharp Etonian young Tory with slicked back hair who followed a traditional Eurosceptic, law-and-order agenda. That all changed with the birth of his eldest son and his coming to terms with his condition. Cameron suddenly found himself sleeping on hospital floors and reading nursery tales to less privileged children in hospital wards in the middle of the night. A more empathetic figure, who speaks with ease about public services, emerged.

Cameron, who is likely to remain off work for two weeks, has spoken openly about the profound impact Ivan had on his life when it became clear in the second week after his birth on 8 April 2002 that he was seriously ill. The future Tory leader said that it was like being hit by a "freight train" when he and Samantha were told that Ivan had Ohtahara syndrome, a neurological disorder.

In the first few weeks, the Camerons took it in turns to sleep beside their son at Great Ormond Street and Queen Mary's hospitals in London as doctors conducted a series of tests and monitored Ivan's condition.

Initially they cared for him without help from their local social services department, although a nurse trained in special needs care helped during the day. But around the time of Ivan's first birthday they decided that his condition was so serious, demanding round the clock attention, that they would seek help.Ivan, whose needs became more acute as he grew older, had to travel everywhere in a special van with a ramp and the basement in their north Kensington home was adapted for him. A lift connected the basement to the rest of the house there was another room for his carer.

Friends say that Ivan changed Cameron on a number of levels. The Etonian arrogance - which was still on display well into the early part of this decade when Cameron was a brash executive at Carlton Television - disappeared.

"When Ivan was born Dave and Sam underwent a profound change which would bring anyone up short," one friend said. "Dave became a much more thoughtful and empathetic person. It knocked the youthful corners off him; he became a little less arrogant."

Cameron's experience also cemented his marriage to Samantha, who went on to give birth to two more children, Nancy and Arthur. Friends say they were always a happy couple but that the experience of caring for Ivan created a special bond between them.

Ivan has also changed his father politically. The swaggering figure of the 1990s and the early part of this decade, in his days as special adviser to Michael Howard as well as at at Carlton, has been replaced by a more sensitive figure whose commitment to the NHS is beyond doubt. Cameron told the Guardian last July how his contact with the NHS had shaped his political views.

"I'm sure it's a significant influence in my life," Cameron said of his experience with Ivan. "And a significant impact in terms of just bringing you into contact with a whole world - not just the NHS but also social services, community nurses, social workers, special schools, therapists, speech and language, hydrotherapy, statementing. You know you become quite an expert in some of these things."

Ivan has left another political legacy for his father which explains why Cameron talks with such passion about what has been dubbed "Broken Britain". Cameron has no wish to adopt the Victorian values of a "back to basics" agenda. But he does believe that all children should be given the chance to be brought up with the love that surrounded Ivan.

It was that love which struck friends when they visited the Camerons' home in London and their cottage in his Oxfordshire constituency. "The great thing Dave and Sam did was to build Ivan into their family; he was a central part of their lives. This was quite an achievement because Ivan wasn't just disabled. He had no control over any of his limbs and he could not take anything by mouth. But he was totally included in a loving family. Dave would, for example, take him swimming and rock him over his shoulder."

Ivan, who would have been seven in April, finally succumbed to cerebral palsy and severe epilepsy early yesterday.

During what Cameron described as a "terrible night", following a normal and lively family pancake dinner on Shrove Tuesday, Ivan died of severe abdominal failure.

He was officially pronounced dead shortly after arriving at St Mary's hospital at 6.30am. However, it is understood that he died at home after a severe seizure; attempts to resucitate him failed.

Cameron once said his family often talked about whether it would have been better to let Ivan die. But friends say the Camerons are in no doubt that they were blessed with a boy who, despite his profound disability, was intelligent and happy.

"Ivan had a wonderful gentle aura with extraordinary eyes," one friend said.

Sign up for the Guardian Today

Our editors' picks for the day's top news and commentary delivered to your inbox each morning.