Cassandra Q. Butts, who was President Obama’s classmate at Harvard Law School and a longtime member of the president’s inner circle who advised him throughout his political career and served as a deputy White House counsel, died May 25 at her home in Washington. She was 50.

She sought medical attention early last week, when she began feeling ill. She died before learning that she had been diagnosed with acute leukemia, her family said.

Ms. Butts met the future president in 1988, when they were filling out financial-aid forms during their first days at Harvard Law School. They had a shared interest in jazz and remained close friends throughout law school and in later years.

Along with Valerie Jarrett, Susan E. Rice and others, Ms. Butts was sometimes described as one of the “Sisterhood” of female advisers especially close to the president and first lady Michelle Obama.

In a statement, the Obamas said Ms. Butts was “always pushing, always doing her part to advance the causes of opportunity, civil rights, development, and democracy. Cassandra was someone who put her hands squarely on that arc of the moral universe, and never stopped doing whatever she could to bend it towards justice.”

Cassandra Q. Butts was one of the “Sisterhood” of female advisers especially close to the president and first lady. (Courtesy of Cassandra Butts)

During their three years together at Harvard Law School, Ms. Butts and Obama often spent time “just sitting around and talking about how we were going to change the world,” she told the Chicago Tribune in 2007. “How do you take this thing we’re learning in law school and make a difference on the issues that we care about?”

She was among the classmates who encouraged Obama to run for president of the Harvard Law Review in 1990. He became the first African American to hold the position.

“In order to publish the Law Review and to be productive in his term as president,” Ms. Butts told PBS’s “Frontline” program in 2008, “he had to figure out how to make it work and how to make both sides work together, which meant that he wasn’t always going to side with his progressive colleagues. It is Barack’s natural inclination to reach across the aisle.”

After graduating from law school in 1991, Ms. Butts was legislative counsel to Sen. Harris Wofford (D-Pa.), then worked on civil rights policy with the NAACP Legal Defense Fund.

She returned to Capitol Hill in 1996 as a top adviser to Rep. Richard A. Gephardt (D-Mo.), who was House minority leader at the time. She helped vet judicial nominees and served as counsel for the House Democratic Policy Committee during the 1998 impeachment hearings on President Bill Clinton.

In 2004, when Obama was elected to the Senate, Ms. Butts helped hire his staff and organize his office. During his presidential run four years later, she was among several former classmates who helped with his campaign. After he was elected, she was general counsel to the Obama transition team and later served as deputy White House counsel.

“Initially, he didn’t have a national network of people who he could call on,” Ms. Butts told Politico in 2008. “The Harvard group was helpful on that front — helping him make introductions on policy, political and financial fronts.”

Ms. Butts was reportedly a key behind-the-scenes figure during the nomination process of Supreme Court Justice Sonia Sotomayor in 2009.

In November 2009, Ms. Butts became a senior adviser at the Millennium Challenge Corp., an independent government agency that develops recommendations on U.S. foreign aid to developing countries.

She was nominated by Obama in February 2014 to be U.S. ambassador to the Bahamas. Beyond a committee hearing, the Senate failed to act to confirm her to the post.

Cassandra Quin Butts was born Aug. 10, 1965, in Brooklyn. She was 9 when her family moved to Durham, N.C. Her father was a businessman, her mother an accountant.

She graduated from the University of North Carolina at Chapel Hill in 1987, then worked as a researcher for African News Service in Durham before going to law school.

In 2000, Ms. Butts was an observer in the Zimbabwean parliamentary elections. She was a senior vice president at the Center for American Progress, a liberal think tank, from 2004 to 2008.

For the past two years, while awaiting confirmation as ambassador to the Bahamas, she served as an adviser to the U.S. Mission to the United Nations.

Survivors include her mother, Mae A. Karim of Durham; her father, Charles Norman Butts of New York City; and a sister, Deidra Abbott of Severna Park, Md.

“I’ve always been confident in Barack’s ability,” Ms. Butts said in 2008, describing Obama’s preparation for the presidency. “And even after law school, I remember telling a couple of people that, you know, I know this guy who is incredibly talented and could be the first African American president of the United States.”