Richard N. Goodwin, a senior adviser and speechwriter for Presidents John F. Kennedy and Lyndon B. Johnson whose later work as an author, journalist and political consultant reflected his unswerving liberal outlook, died on Sunday at his home in Concord, Mass. He was 86.

Mr. Goodwin’s wife, Doris Kearns Goodwin, the Pulitzer Prize-winning biographer and historian, said he died after a brief bout with cancer.

The author of books and articles on public policy and a play, Mr. Goodwin was for years identified with the Kennedy clan and with leaders of the Democratic Party.

In 2000 he helped write the concession speech that Vice President Al Gore delivered after the Supreme Court halted the Florida recount in the presidential election, effectively handing the White House to George W. Bush. In 2004 he was a campaign consultant for the Democratic presidential nominee, Senator John Kerry of Massachusetts, and in 2008 Barack Obama consulted him in his presidential campaign.