William Lee Miller, a historian who explored the confluence of politics, religion and ethics and wrote an account of the congressional battle to end slavery, as well as books about Abraham Lincoln, died May 27 at a hospice in New York. He was 86.

He had congestive heart failure, said his wife, Linda Miller.

Dr. Miller was a Yale-educated theologian who spent 17 years as a professor at the University of Virginia before retiring in 1999. He wrote hefty tomes — often spanning 500 pages or more — about five presidents and, by many accounts, he did it with eloquence and ease.

In a 1976 Washington Post essay, Dr. Miller described himself variously as “a Hoosier and an American, a writer, a politician and a former alderman, a basketball fan, a moralist, a political scientist, a professor, a Presbyterian, and a reader of both Robert Benchley and Reinhold Niebuhr.”

As a historian and ethicist, he rose to prominence in the late 1990s with his book “Arguing About Slavery,” describing John Quincy Adams’s struggle to bring a debate on slavery to Congress.

The book centers on the “gag rule,” a resolution passed by the U.S. House of Representatives in 1836 that prevented any action related to slavery from reaching the legislative body. Dr. Miller said he was fascinated by the gag rule and its eventual dissolution at the hands of Adams, who served in the House after his presidency.

The subject “grabbed me by the collar, threw me upon the floor, sat upon my chest and insisted upon being told,” Dr. Miller once wrote.

In a New York Times review, historian Drew Gilpin Faust called Dr. Miller’s account “an inspiring tale, one likely to imbue its audience with a sense of pride in the workings of American Government and a renewed commitment to belief in its possibilities.”

The work won the D.B. Hardeman prize as the best book published in 1995 about Congress.

Dr. Miller’s best-known books include a two-part “ethical biography” of Lincoln. The first, “Lincoln’s Virtues” (2002), was an an analysis of the president’s ethical growth before he took office.

A Los Angeles Times review of the book called it a worthy addition to the stable of tomes about the 16th president because “it tackles a familiar subject from an unusual angle, giving appropriate centrality to Lincoln’s moral convictions.”

In an otherwise favorable review, historian Eric Foner wrote in the New York Times in 2002 that Dr. Miller — with his 515-page book — should have paid more attention to Lincoln’s well-known brevity.

The second book, “President Lincoln: The Duty of a Statesman” (2008), is a continued study of the commander-in-chief’s moral development while in office.

In a Post review, Lincoln expert Michael F. Bishop wrote that Dr. Miller “is uncommonly skilled at blending narrative and analysis.”

He continued: “The reader is swept smoothly along by his charming, avuncular prose as he portrays Lincoln’s magnanimity toward opponents, concern for the suffering of others and eagerness to pardon the condemned.”

William Lee Miller was born April 21, 1926, in Bloomington, Ind. His father was a Presbyterian minister.

He was a 1948 graduate of the University of Nebraska. At Yale University, he received a bachelor of divinity degree in 1950 and a doctorate in religious social ethics in 1958. While serving on the Yale faculty in the 1960s, he represented the 15th ward of New Haven, Conn., as an alderman.

His marriage to Lou Horton ended in divorce. Survivors include his wife of 30 years, Linda Moore Miller of New York; four children from his first marriage, Rebecca Uchida of Evanston, Ill., Cynthia Coffel of Iowa City, Iowa, David Miller of Falls Church and Andrew Miller of Bloomington; two stepdaughters, Jennifer Bernstein of New York and Sarah Steven of Great Barrington, Mass.; a brother; a sister; and 10 grandchildren.

Dr. Miller’s final book, “Two Americans: Truman, Eisenhower, and a Dangerous World,” comparing the public and private worlds of two mid-century presidents, was published in April.