NEW YORK - TED Sorensen, one of President John F. Kennedy's key advisers and top speech writers, died on Sunday aged 82.

Sorensen's death was confirmed by his wife Gillian, The New York Times reported on its website. Sorensen suffered a stroke in 2001 and had another just over a week ago.

A retired lawyer and recipient of the National Medal for Humanities in 2009, Sorensen was most closely associated with Kennedy, and known for liberal leanings seen as having doomed efforts to make him head of the CIA under Jimmy Carter.

A conservative backlash against his comments about the CIA and his liberal association with the Kennedy White House quickly doomed efforts to put Sorensen in charge of the US spy agency before they even got off the ground in 1977.

But just 15 years before, Sorensen had been at the seat of power, advising Kennedy on such matters as the Cuban missile crisis and writing the words spoken by one of the country's most articulate presidents.

He was credited with composing some of Kennedy's most famous phrases, despite protesting that he did not. One columnist claimed Sorensen had written, not just researched and edited, Kennedy's Pulitzer Prize-winning book, Profiles in Courage. Later, one of Kennedy's most oft-quoted lines from his inaugural address - 'Ask not what your country can do for you; ask what you can do for your country' - was also attributed to Sorensen, who worked on the speech but insisted Kennedy wrote those words.

JFK aide Sorensen dies at 82