Ted Sorensen, who served as President John F. Kennedy's adviser and primary speechwriter, died Sunday in New York City of complications from a stroke he suffered last week. He was 82.


Sorensen's passing comes only days before the 50th anniversary of Kennedy's election as president. 

It was Kennedy's inaugural speech that remains one of his greatest collaborations with Sorenson including its famous line, "Ask not what your country can do for you, ask what you can do for your country." 

Sorenson said that Kennedy wrote the line, calling on Americans for self-sacrifice and involvement in the nation's future. The well-know address also promised to spare no effort to preserve liberty, 15 years after the end of World War II and before the height of the Vietnam war and a string of high-profile assassinations, including Kennedy, his brother Robert and Martin Luther King Jr. 

"Let every nation know, whether it wishes us well or ill, that we shall pay any price, bear any burden, meet any hardship, support any friend, oppose any foe, in order to assure the survival and the success of liberty."

President Obama issued a statement saying he was saddened to learn of Sorensen's death.

"I know his legacy will live on in the words he wrote, the causes he advanced, and the hearts of anyone who is inspired by the promise of a new frontier," Obama said.

Sorensen also helped Kennedy write "Profiles in Courage," the 1956 book that garnered a Pulitzer Prize. He eventually became part of the president's inner circle, helping him with major speeches and in his correspondence with Soviet leader Nikita Khrushchev during the Cuban Missile Crisis.

After Kennedy's assassination, Sorenson went into private practice with New York's Paul, Weiss, Rifkind, Wharton & Garrison LLP. His 1965 biography of JFK, "Kennedy," was an international bestseller.

"I can really say he lived to be 82 and he lived to the fullest and to the last - with vigor and pleasure and engagement," said his wife Gillian Sorensen, who was at his side when he passed. "His mind, his memory, his speech were unaffected."

Her husband was hospitalized Oct. 22 after a second stroke that was "devastating," she said.