Indeed, by the end of his life, Senator Kennedy had become a kind of father figure to Mr. Obama, something the president lacked during much of his childhood. During the presidential campaign, after Kennedy’s endorsement of Obama in January 2008, the freshman senator from Illinois came to rely on the advice of the senior senator from Massachusetts.

And it was Kennedy who gave the Obamas their Portuguese water dog, Bo, this past spring – a small indication of how the senator had become family to the first family.

But the Kennedy-Obama bond was a relatively recent phenomenon. Though Kennedy had encouraged Obama to run for president, the two were not close friends in the Senate. Obama, after all, had arrived there only in 2005. Kennedy held back in issuing an endorsement during the heated primary battle between Obama and another Senate colleague, Hillary Rodham Clinton.

The timing of Kennedy’s endorsement, on Jan. 28, 2008, was crucial. The South Carolina primary had just taken place, and the debate had become racially charged. News accounts indicated that Kennedy was not pleased with how former President Clinton had handled himself. More important, it was the eve of Super Tuesday, when a large portion of the delegates would be awarded. Obama and Senator Clinton were neck and neck.

Kennedy and his niece Caroline, the daughter of former President Kennedy, made their announcements for Obama in tandem. The news electrified the campaign.

“My sense is that both Caroline and Ted Kennedy saw a lot of John Kennedy in Obama,” says Democratic strategist Peter Fenn, whose father worked in the Kennedy White House and was the first director of the Kennedy Presidential Library in Boston. “They sensed that he was the sort of person who was very cool under pressure, who had a vision of where he wanted to take the country ... and that the times demanded the kind of leadership that John Kennedy exhibited.”

Whether Obama owes his nomination – and his election – to Kennedy will always be a matter of speculation. Obama, after all, did not even win the Massachusetts primary, which took place on Super Tuesday, eight days after the Kennedy endorsement. But certainly, analysts say, the nod from key members of America’s first family of Democratic politics helped make Obama more acceptable to working-class voters – a demographic that Clinton had been winning. And Obama now had the force of history behind him.

In his endorsement, Kennedy firmly rejected Clinton’s main argument against Obama: that he wasn’t ready to lead. Obama is “ready to be president on Day 1,” Kennedy said.

A new book on the campaign, “The Battle for America 2008,” describes the run-up to the Kennedy endorsement.

“He told Obama that at the beginning of the campaign he was looking for somebody to inspire the nation, and how impressed he had been by Obama’s emphasis after his Iowa victory on the importance of ending the longtime divisions within the country,” write co-authors Dan Balz and Haynes Johnson. “Obama’s inspiration was what the country needed.”

In agreeing to the endorsement, Kennedy got Obama to promise that he would make comprehensive healthcare reform an early, top priority as president, the authors write. Obama has done that. Now, with Kennedy unable to help him finish the job, the weight on Obama’s shoulders is a bit heavier.