“Mr. Lincoln,” Mr. Douglass answered, “that was a sacred effort.”

In those years, a black dresssmaker and former slave, Elizabeth Keckly, was Mary Todd Lincoln’s confidante. And in the next three decades, black singers, including the Fisk Jubilee Singers, Marie Selika Williams and Sissieretta Jones, entertained at the White House. But none of the singers were invited to stay for meals, a taboo that would last well into the next century.

Lou Hoover, the wife of Herbert Hoover, found that to be a problem in 1929, after Oscar De Priest became the first African-American elected to Congress since Reconstruction. She was admonished not to invite Mr. DePriest’s wife to her traditional tea for Congressional wives, so instead she arranged a separate tea party for Mrs. DePriest. But the event still drew a resolution of criticism from the Texas Legislature.

Eleanor Roosevelt, who was Theodore’s niece as well as Franklin’s wife, famously included African-Americans among her many guests at the White House, and she, too, was criticized  including when she invited Marian Anderson to follow her concert at the Lincoln Memorial in 1939 by singing at the White House before the king and queen of England.

The postwar wave of independence that swept the world changed Washington’s diplomatic scene. Black diplomats became regular guests at state dinners, and African heads of state were invited to sleep overnight. Still, most presidents reserved the White House guest rooms almost exclusively for family and close friends.

But African-Americans were gaining in political power  in Congress, in the cabinet, as aides  and starting in the 1970s became familiar figures in and near the Oval Office.

The first African-American guests invited to sleep in the White House are believed to have been Sammy Davis Jr. and his wife, Altovise, in 1973, by Richard Nixon. Mr. Davis was struck by the history. He later joked that he turned down the chance to sleep in the Lincoln bedroom in favor of the Queen’s room. “I thought to myself, now I don’t want [Lincoln] coming in here talking about, ‘I freed them, but I sure didn’t want them to sleep in my bed.’ ” (The singer Pearl Bailey, a friend of Betty Ford, also stayed overnight, after Nixon’s resignation.)

In the 1990’s, the Clintons, unique among modern first families, widened the circle of guests and political contributors who were invited to stay over, including a range of celebrities and politicians like Quincy Jones, Will Smith and his wife, Jada Pinkett Smith, and Willie Brown.