WASHINGTON — Between Civil War battles in early 1864, Clara Barton was stuck in Washington with time on her hands. She was mentally exhausted by physical inactivity during a winter pause on the front, and frustrated that her latest effort to open a new warehouse for supplies hadn’t panned out.

“I am depressed and feel dissatisfied with myself,” she wrote in fine, tiny script in diaries now stored on microfilm in the Library of Congress. With so little to do, she paradoxically couldn’t rest, and so “rose not refreshed, but cold and languid.” For neither the first nor last time, she considered suicide.

“All the world appears selfish and treacherous,” she wrote on April 14. “I can get no hold on a good noble sentiment any where. I have scanned over and over the whole moral horizon and it is all dark. The night clouds seem to have shut down — so stagnant, so dead, so selfish, so calculating. . . . Shall the world move on in all this weight of dead, morbid meanness?” A few days later, she fantasized again about killing herself.

But then, as Elizabeth Brown Pryor wrote in her 1987 biography, “Clara Barton: Professional Angel,” the self-made philanthropist’s “dejection was lifted finally by her only true remedy — a need for her services. The Union army’s spring campaign had started early.”

When every single man assisting at a surgery in Antietam ran for cover under fire in 1862, Barton had not only stayed but gloried in having bested the boys; the sort of duty that incapacitated others brought Barton back to life. And so, in spring 1864, with the death of thousands in the woods of Spotsylvania County, Va., she restocked supplies and was off again to care for the wounded. Not long after, a co-worker saw her, according to Pryor, “as a cheerful spirit, breezing through the wards in a blue dress and white apron, rousing the men by singing ‘Rally Round the Flag, Boys.’ ”

Throughout Barton’s long, difficult and staggeringly successful life, she self-medicated through service, her diaries reveal, using the most intense, bloody work imaginable to keep the “thin black snakes” of sadness from closing in. And, fortunately for Civil War soldiers, women voters, anyone who has been helped by the American Red Cross, and every GI who ever wore a dog tag, Barton did not take her own life — and instead died of pneumonia in her Glen Echo, Md., home 100 years ago at age 90.

Her obituary, which made the front page of The New York Times on April 13, 1912, said: “Clara Barton was President for twenty-three years of the Red Cross Society, which was established in this country through her efforts. She retired in May, 1904, on account of factional quarrels within the organization. But long before the society was founded she had become famous for her work on battlefields in the civil war and in the Franco-Prussian war.”

Indeed, it’s hard to imagine how Barton could have accomplished more. And easy to wonder if a happier woman would have fought as she did — with presidents and nobodies, over great injustices and petty slights.

So did Clara Barton accomplish all that she did in spite of her depression or because of it?

No one alive knows more about Barton than Pryor, and in a phone interview, the biographer insisted that Barton eventually prevailed over her depression. “This crippling mental condition was real, and she conquered it, and she did solve it” both through work and seeking out strategies, in quite a modern way, for better managing her symptoms. “She did learn.”

Yet Barton’s diaries — later discovered behind a wall in her former home, now a national historic site — suggest that she accomplished all she did not by outrunning or decapitating those thin black snakes, but by following them, to Armenia after atrocities and to the Andersonville prison in Georgia after Appomattox.

Calmest in a crisis, most fully functional as others panicked, she did her best work in the dark.

How Clarissa Harlowe Barton of North Oxford, Mass., came to be pursued by those snakes is not a mystery lost to history. As Pryor put it on the phone, “Talk about a dysfunctional family.”

The youngest of five, Barton had a sister who was so seriously mentally ill that she was kept locked in her room. One of her two brothers was indicted for bank robbery, and the other committed suicide in middle age.

A small volume intended to be the first in a series of memoirs, “The Story of My Childhood,” which came out in 1907, is as prettified as Barton’s diaries are stark, but this passage stands out: “In these later years I have observed that writers of sketches, in a friendly desire to compliment me, have been wont to dwell upon my courage, representing me as personally devoid of fear, not even knowing the feeling. However correct that may have become, it is evident I was not constructed that way, as in the earlier years of my life I remember nothing but fear.”

And not without reason. Her father, Capt. Stephen Barton, had served under “Mad Anthony” Wayne in the French and Indian War, and “his soldier habits and tastes never left him,” she wrote. He and Barton’s mother, Sarah, fought loudly and often.

According to “Clara Barton: Professional Angel,” profane, hard-to-please Sarah was odd in highly original ways, intentionally waiting until produce was half-rotten before serving it to the family. She’d spend all day baking pies, then fly into a rage if anyone asked for a piece, and hide them in the basement until they had to be thrown out. On one occasion, she dismantled a new stove her husband had bought her — What kind of gift is that? — and threw it piece by piece into the pond on their farm.

There were good times in Clara Barton’s childhood, too — horseback riding with her older brother David, for instance — but the highlight of her formative years was by all accounts the two years she spent nursing David back to health after a fall.

Beginning at age 11, she wrote in her memoir, she was so tethered to her brother’s side that she all but forgot about the world outside her home: “This singular mode of life, at so young an age, could not have been without its characteristic effects. In some respects it had served to heighten serious defects. . . . I had grown even more timid, shrinking and sensitive in the presence of others; absurdly careful and methodical for a child.”

Instead of feeling, once her brother recovered, “that my freedom gave me time for recreation or play, it seemed to me like time wasted, and I looked anxiously about for some useful occupation.”

She wears out that word “anxiously,” and today we might well say she suffered from an anxiety disorder. But the attention and gratitude that came her way as her brother’s nurse, along with the intensely pleasant feeling that she was accomplishing something, also made her eager to repeat the experience.

While she was still a teenager, her family persuaded her to take a position as a teacher in a local school. A child herself, she understood her charges and expected the best of them in a way that tended to be self-fulfilling.

As a young woman, she and a group of girlfriends had made a pact never to marry, and she never seems to have been seriously tempted to break that vow. Still, while teaching in Hightstown, N.J., a broken love affair she writes about only cryptically in her journals seems to have pushed her into full-blown depression. As Pryor writes: “It is tempting to view these musings as Barton’s earliest struggle with what was to become a lifelong battle against chronic depression. Her words suggest, however, that this low period in the spring of 1852 was simply part of a continuum.”

Again and again, her diaries bear that out. In a notation on Wednesday, March 24, 1852, Barton writes that she is “more and more certain every day that there is no such thing as friendship — at least not for me, and I will not dupe or fool myself. … It is all false — in fact the whole world is false. This brings out my old inquiry. What is the use of living in it. I can see no possible benefit deriving from my life.”

Even then, the question of whether to go on living is an old inquiry — and one she revisits. A week later, on March 31, she sees her future as dreary and survival a kind of punishment. “I shall survive it all and go on working at some trifling, unsatisfying thing, and half-paid at that.” Judged she certainly was, and sometimes not paid at all, but trifling, never.

The “half-paid” reference was not just her fear talking; in her next teaching job, in Bordentown, N.J., she started the state’s first free public school, a model replicated elsewhere in the state. This achievement did send the snakes into hiding for a time, and she reveled in her progress — until, that is, she made such a success of the project that a man was hired to take it over, at three times the pay.

Later that year, she and a friend moved to Washington, where she got a job as one of the first female employees of the federal government, working as a copyist in the U.S. Patent Office. Her Times obit has her running the place: “In a short time she had transformed her department into a model of efficiency and discretion. During Buchanan’s administration she was discharged because of her strong Republican leanings, but in a short time it was found necessary to recall her, in spite of her politics.” Translation, according to her biographers Pryor and Stephen B. Oates, who wrote “A Woman of Valor: Clara Barton and the Civil War”: After her patron left, her pay was cut, again to a fraction of what the men in the office were making, and for a time, she was forced to do piece work copying at home, because it was seen as inappropriate for men and women to share an office. When she was finally fired altogether, according to Oates, she “returned to Massachusetts and drifted aimlessly for three depressing years” before eventually getting her old Washington post back.

Then the war broke out, and she all but forgot about her day job.

On April 19, 1861, the first day blood was shed — as Union soldiers from her home state of Massachusetts passed through Baltimore — she was beside herself even before reaching them: “thrilled and bewildered,” she told her sister, who was with her.

As it happened, nearly 40 of the men in the Sixth Massachusetts Regiment were her former students — her boys, as she came to call all soldiers, in a real way. And after seeing that no real provisions had been made for them in Washington, the next day she bought all the food and supplies she could find, engaged workers to help her carry them, and, in Pryor’s magnificent account, swept down Pennsylvania Avenue and into the Senate chamber, which had been turned into a makeshift hospital, where she sat in the seat normally reserved for the president of the Senate and read to them from the Worcester Spy newspaper. With 75,000 troops pouring into Washington, the city, she said, had “grown up so strangely like a gourd all in a night.” In a way, at age 40, so had she.

In the years that followed, Barton took it upon herself to raise money to fill entire warehouses with supplies that she personally delivered to the battlefield. When she was fully engaged, her journal entries paradoxically became less dramatic, introspective and fraught; for one thing, there wasn’t time for that.

At work and at war, she reveled in being where the action was. Arriving at Hilton Head on April 12, 1863, she was downright giddy to be reaching shore just as the shooting on Charleston, S.C., was starting: “I had never missed of finding the trouble I went to find,” she bragged to herself, “and was never late.”

She had her most serious love affair there, with a married Union captain whom she saw shot during the battle for Battery Wagner. (Again “finding the trouble I went to find,” she dragged him to the beach, nursed him back to health and got out of town just ahead of his wife.)

After seeing for herself the bravery of the black soldiers of the 54th Massachusetts Regiment Voluntary Infantry — the first Union regiment recruited from freed slaves to fight in the Civil War — she became an energetic advocate for the rights of African-Americans, and though she hated public speaking, passionately railed against racial and gender bias during her long national speaking tour after the war.

So, mission found and problem solved?

In the main, depression doesn’t work like that, and Barton’s dark moods continued to come over her in waves, usually between periods of intense activity. Then she’d get back up and throw herself into new projects, none of them trivial.

After the war, she dreamed up and organized a “missing man” office (authorized by President Lincoln himself), and according to the Times obituary, “Of the 1,300 graves of soldiers who died at Andersonville Prison, she was able to identify all except 400.” The whole concept of “leave no man behind” grew out of the effort.

After that work wound down, in 1869 she went to Switzerland, where she was supposed to be recovering from another breakdown, when she became acquainted with the International Red Cross and spent many years fighting to get it founded, recognized and funded in the United States. Beginning in 1876, she started doing what we’d now see as self-admittance to a rehab center, in Dansville, N.Y., where a forward-thinking doctor prescribed natural foods, whole grains, exercise and mental stimulation.

She personally led relief efforts after the Johnstown flood, a hurricane that nearly wiped out the Sea Islands and a storm that leveled Galveston, Texas, in 1900. She had lunch on the USS Maine two days before it blew up in Havana harbor in 1898, and during the Spanish-American War, she worked 16-hour days at age 77.

Pryor says in her book that Barton never again had another breakdown, but according to her diaries, she did again contemplate suicide, in 1904, though as before, she never seems to have made an attempt. She saw the Red Cross as her child, and as it was being taken away from her, she was again tempted to end her life. “I seem to feel but one impulse — one desire, to get away from it all,” she wrote Feb. 3.

To the end, she feuded with friends and wrestled with herself. As you read her diaries, it’s hard not to feel that it was fighting that kept her going so long.

During one of her last lucid moments, she described a vivid dream in which she had found herself back on a battlefield, tending Union troops: “I crept round once more, trying to give them at least a drink of water to cool their parched lips, and I heard them at last speak of mother and wives and sweethearts, but never a murmur or complaint.

“Then I woke to hear myself groan because I have a stupid pain in my back, that’s all. Here on a good bed, with every attention. I am ashamed that I murmur.” Two days later, she awoke one final time, cried, “Let me go!” and died.

Melinda Henneberger is a political writer for The Washington Post.