Shown is the haversack used by Walt Whitman before being displayed to the public at the Library of Congress. (Ricky Carioti/The Washington Post)

In 1888, four years before he died, the aging poet Walt Whitman showed a friend an old leather shoulder bag hanging on the wall of his home in Camden, N.J. It had an adjustable strap with a decorative buckle and had seen hard use.

He’d gotten it long ago, in the Civil War, Whitman said. He’d sling it over his shoulder on his legendary visits to the hospitals in Washington, to carry food and gifts to wounded and dying soldiers.

“A souvenir of those days,” he told his friend. He hadn’t used it in years.

Next month, Whitman’s venerable “haversack” — a symbol of one of the war’s great acts of compassion by one of its great writers — will go on display at the Library of Congress, apparently for the first time.

The library has had it since 1969, when the bag was acquired from the noted Whitman collector Charles Feinberg, but library officials found no record that they have ever had it on exhibit.

American writer Walt Whitman (The Associated Press)

Whitman is known as one of America’s best poets, a robust, flamboyant figure who portrayed himself, and mid-19th-century America, as alive with muscle and vitality.

Less well known, perhaps, is his role in Washington during the Civil War, when he frequented the local hospitals, which were often jammed with thousands of injured, sick and dying soldiers.

Moved by the horror of the war’s damage to helpless young patients, Whitman made hundreds of visits, toting the haversack packed with fruit, brandy, sweets, tobacco, clothing, money, newspapers.

He often sat with dying soldiers, comforting them, holding their hands. He wrote letters to their families after they died. He even dressed a few wounds and stayed for days and nights in a row.

He wore his gray hair and bushy beard long, to seem more avuncular, but was always clad nicely to help cheer the men up.

The library plans to exhibit the haversack, which is extremely fragile, along with some of Whitman’s letters.

Also on display will be one of his notebooks, in which he has penciled his terse observations: “Dec 20th Sight at the Lacy house — at the foot of tree immediately in front a heap of feet arms and human fragments . . . bloody black and blue swollen and sickening.”

The items will be presented some time next month, as the library removes pieces currently in its Civil War in America exhibit for preservation purposes and replaces them with new objects.

Other items being added include handwritten pages of Abraham Lincoln’s first and second inaugural addresses, a rare volume of Confederate sheet music, and Union and Confederate recruiting posters.

In the hospitals, Whitman spent many hours doing what he called “the abstract work of consolation and sustenance.”

“He had a very comforting personality,” said Alice Lotvin Birney, a Whitman expert and literary specialist in the library’s manuscript division. “His presence emanated and projected good spirits and good feelings to the soldiers.”

“Why did he do it? Out of compassion, I would say,” Birney said. “Because [the war] was the biggest thing that was happening in American history, and he clearly saw himself as America’s poet.”

But it would take a toll on him.

Whitman was 43, and an established poet living in Brooklyn, when he came through Washington in late 1862.

He came to check on his brother, George, a Union officer who was listed as wounded at the Battle of Fredericksburg that December.

He had his pocket picked en route and arrived in Washington penniless. He scoured the hospitals, then managed to get by boat and train to Falmouth, Va., where he found the army and his brother — alive and only slightly wounded.

He stayed 10 days and was stunned by what he saw.

“The wounded . . . [lie] on the ground, lucky if their blankets are spread on layers of pine,” he wrote of the scene after the war. “No cots. Seldom even a mattress. It is pretty cold. The ground is frozen hard and there is occasional snow.”

On Dec. 29, he was back in Washington, traveling with a cargo of injured soldiers and determined to stay and observe the cataclysm first hand.

The Washington area then had as many as 50 military hospitals, said Barbara Bair, a library historian and 19th-century specialist in the manuscript division. Whitman recorded that a hospital might hold between 500 and 1,500 patients, and they were often all full.

“I think he had a kind of epiphany that he felt he had a calling,” Bair said, “a kind of spiritual calling.”

Whitman wrote of his visits in 1863:

“I always carry a haversack with some articles most wanted — physical comforts are a sort of basis. I distribute nice large biscuit, sweet-crackers, sometimes cut up a lot of peaches with sugar, give preserves of all kinds, jellies, &c. tea, oysters, butter, condensed milk, plugs of tobacco.”

Most of the soldiers he saw were between the ages of 15 and 25, with “lads of 15 or 16 more frequent than you have any idea,” he reported.

Whitman often visited the 1,000-bed Armory Square Hospital complex, which was on the Mall, where the National Air and Space Museum is today. It was close to the Sixth Street landing on the Potomac River, where the wounded arrived.

He watched one rainy night as the wounded came in from the Battle of Chancellorsville in May 1863:

“You ought to see the scene . . . pale, helpless soldiers lay around on the wharf . . . the few torches light up the spectacle . . . the men are lying . . . with bloody rags bound round heads, arms, and legs.”

In the hospital, he found “some of the men . . . fearfully burnt from the explosions of artillery caissons.”

“Amputations are going on. The attendants are dressing wounds,” he wrote. “As you pass you must be on guard where you look.”

Two months later, he sat with a young soldier, 19 or 20 years old, named Erastus Haskell, who was dying of typhoid fever.

“This young man lies within reach of me, flat on his back . . . his thick black hair cut close . . . every breath a spasm. It looks so cruel. He is a noble youngster . . . Often there is no one with him for a long while. I am here as much as possible.”

Along with physical wounds and sickness, he saw evidence of mental injury.

In a letter that will be on exhibit, he wrote his mother in 1864: “One new feature is that many of the poor afflicted young men are crazy. Every ward has some in it that are wandering. They have suffered too much and it is perhaps a privilege that they are out of their senses.”

“I see so much of butcher sights,” he had written her the year before, “so much sickness and suffering, I must get away a while, I believe, for self preservation.”

Whitman stayed in Washington until he suffered a stroke in 1873 and moved to Camden to stay with his brother, George. But he often reflected on the hospital scenes during the war.

And many of his patients remembered him fondly.

In 1867, a man named Hiram Sholes, a former patient at Armory Square Hospital, wrote Whitman from Albany: “How well can I remember you as you came into the Wards with the Haversack under your arm giving some little necessary here, a kind word there.”

“I thank you for all this and you in your lonely moments must be happy in thinking of the good you have done to the many suffering ones during the war.”

The exhibit is in the library’s Thomas Jefferson Building, First Street and Independence Avenue SE. The country is now marking the sesquicentennial, or 150th anniversary, of the Civil War years, 1861 to 1865.