James H. Billington, the librarian of Congress for nearly three decades, who led the nation’s treasure house of knowledge into the digital age and added millions of books, films and cultural artifacts to its historic collections, including a trove of tweets, died on Tuesday in Washington. He was 89.

His daughter Susan Harper Billington said the cause was complications of pneumonia.

Mr. Billington’s death came a little more than three years after he retired amid mounting criticism that he had presided over a series of management and technology failures in his last years in office. He stepped down in September 2015, having planned to retire at the end of the year. He was succeeded by Carla D. Hayden, the first woman and the first African-American to lead the Library of Congress.

Mr. Billington, a distinguished authority on Russian and Soviet history, was named by President Ronald Reagan in 1987 as the 13th director of the library, the repository of the American experience founded in 1800 under legislation that shifted the capital from Philadelphia to Washington.

He arrived at the dawn of a new era. The internet was in its infancy, newspapers and printed books were thriving, computers were relatively unsophisticated, and Google, Facebook and Twitter were still over the horizon. For all its millions of books and manuscripts in 450 languages, its 550 miles of shelves and 19 reading rooms, the Library of Congress was terra incognita to most Americans, even to many scholars.