The Civil War, as every former high school student knows, ended slavery--but perhaps not quite the way the story was always told in high school.

Before Abraham Lincoln and the federal government had come to a final judgment on the slavery question, tens of thousands of blacks had enlisted in the Union Army and made the Civil War a "self-liberating experience," says historian Ira Berlin. Black soldiers who started out calling every white man "boss" or "captain" gradually learned, according to Berlin, "that not every white man is a captain--some are corporals and some are sergeants." They also learned all the laws, rules and customs that insulate a soldier from the whims of his superiors, and they carried that sophistication back with them into the fight to gain freedom and full citizenhood for the still-enslaved.

This is the view of emancipation that emerges from an extraordinary book of documents unearthed over the last several years by a team of scholars from the University of Maryland. "We think this is going to change the kind of history that's written at all levels," says Berlin, who headed the project with Joseph P. Reidy and Leslie S. Rowland.

"They have done something which no individual historian has ever done or could ever do," says Columbia University historian Eric Foner. "It's absolutely indispensable for anyone interested in the history of this period . . . Probably three-quarters or more of the material they published has never been seen by anybody since it was written."

Besides offering an unprecedented look at what ordinary people, white and black, thought and did as they saw slavery grinding to an end, "The Black Military Experience"--the first published volume of a planned series with the overall title, "Freedom: A Documentary History of Emancipation"--shows how slaves and free blacks, in Foner's words, "seized the opportunity presented by the war to unravel the institution of slavery . . ."

In the fall of 1863, black soldiers from the North began agitating for the same $13-a-month pay as whites, often flatly refusing the $7 the War Department had decided to offer them ($10 minus a $3 clothing deduction). Later. the protest spread to ex-slave soldiers from the South, and "for most slaves," says Berlin, "probably the first political act that they engage in is this struggle over equal pay."

It was a hard struggle. Many black soldiers went months without pay to press their claims, even though they had families at home depending on them for support. A few who took more active steps actually lost their lives as a result. The book includes the court-martial testimony of a black sergeant, William Walker of the Third Regiment of South Carolina Volunteers, accused of urging mass-desertion over the pay issue. Walker reminded the "honorable court" that he had been pressed into enlisting on the promise of equal pay, and he pleaded for "an enlightened understanding of the matter." But the next document in the book is the order for Walker to be "shot to death with musketry" on Feb. 29, 1864--an order carried out on schedule.

Other soldiers took the less risky route of writing to politicians, military commanders or President Lincoln himself. As Cpl. James Henry Gooding put the case in a letter to Lincoln: "Now the main question is. Are we Soldiers, or are we LABOURERS . . . Today, the Anglo Saxon Mother, Wife, or Sister, are not alone, in tears for departed Sons, Husbands, and Brothers. The patient Trusting Decendants of Africs Clime, have dyed the ground with blood, in defense of the Union, and Democracy . . . We appeal to You, Sir: as the Executive of the Nation, to have us Justly Dealt with . . ."

Gooding's letter wound up in the annals of the Army's Bureau of Colored Troops, one of about two dozen major groups of papers screened by Berlin and his team during the three years they camped out in the National Archives. They also looked at, among other records, those of the Freedmen's Bureau, the Treasury Department (which supervised the management of abandoned plantations in the occupied South), and various units of the defeated Confederacy, since one of the lesser-known fruits of war, as Berlin notes, is that "the winners get the losers' records."

From all those documents, "you get a sense of what people standing on the edge between slavery and freedom thought at that moment," Berlin says. "This is the fullest record that exists anywhere in the world of a people going from being slaves to being free."

In the course of their labors, Berlin and his comrades occasionally made finds so stunning that all work would come to a halt and "we'd have public readings in the archives," he says.

Sometimes a series of documents from separate sources, found at separate times, could be linked up to tell a single story. The strange tale of Edwin Belcher, for example, begins with a fragment of a letter in which a Union veteran who had served with a white regiment revealed that he was the victim of rumors suggesting he was black. Later, Belcher wrote that he had looked into the question himself and discovered he was black. But as additional documents revealed, he had really known his heritage all along, having been raised in Philadelphia by his ex-slave mother after they had been sent North by his plantation-owner father. Belcher decided to pass for white during the war, but afterward, when the truth began to surface, he "crossed over the street" again and, says Berlin, became a successful black politician.

The correspondence of Pvt. Spotswood Rice offers a powerful glimpse into an ex-slave's attitudes toward his former masters, and vice versa. Rice had gained his freedom by enlisting, but he had been forced to leave his family in slavery. From a military hospital in St. Louis, Rice wrote his daughters promising to return to them with "8 hundred White and 8 hundred blacke solders" and secure their freedom.

"Be assured that I will have you if it cost me my life," he wrote. "If Diggs dont give you up this Government will . . . Your Miss Kaitty said that I tried to steal you But I let her know that god never intended for man to steal his own flesh and blood . . . I once thought that I had some respect for them but now my respects is worn out and have no sympathy for Slaveholders . . . You tell her from me that She is the frist Christian that I ever hard say that aman could Steal his own child especially out of human bondage."

He also wrote to the wife of his former owner, telling her: "I offered once to pay you forty dollars for my own Child but I am glad now that you did not accept it . . . Just hold on now as long as you can and the worse it will be for you . . . iff your conchosence tells thats the road go that road . . ."

These letters were seized by Mrs. Diggs' husband, postmaster F.W. Diggs, who angrily forwarded them to the army command, demanding Rice's removal from the state for the sake of the Diggs family's security. Diggs complained that he had been loyal to the Union, but all his property was tied up in slaves and "to be thus insulted by such a black scoundrel is more than I can stand."

(Diggs, a Missourian, wrote his letter in September 1864 when slaveholding was still legal in border states.)

Other black soldiers--there would be 179,000 of them by the spring of 1865, representing 21 percent of all black men in America between the ages of 18 and 45--raised their sights beyond the goal of emancipation itself.

Sgt. John Sweeny, a former Kentucky slave, wrote to Brig. Gen. Clinton Fisk proposing a school for the "moral and literary elevation" of his regiment. " . . . We stand deeply inneed of instruction the majority of us having been slaves . . ." Sweeny noted. "my home is in Kentucky Where Prejudice reigns like the Mountain Oak and I do lack that cultivation of mind that would have an attendency To cast a cloud over my future life after have been in the United States service . . ."

Much of the spelling and punctuation in "The Black Military Experience" is haphazard, but there is no "minstrel speech--no 'dems' and 'dese,' " according to Berlin. "This kind of book tends to do away with stereotypes of one kind and another," adds Benjamin Quarles, emeritus professor of history at Morgan State University in Baltimore. "We would never have dreamed there were that many articulate blacks, literate blacks," says Quarles, "and we didn't believe that the black issue was so dominant in the military and in Washington."

The book also illuminates the response of whites to the approach of emancipation. The first black troops were raised in Massachusetts and other abolitionist strongholds, and their commanders--all white--were usually avowed abolitionists. But later, as the Union became more broadly committed to the idea of using black soldiers and began offering freedom to slaves who enlisted, commanders were chosen by a more random process, and opportunists saw such assignments as the route to a quick promotion.

Initially, many of these commanders treated their subordinates with open hostility. But as time went by and the black units gained experience in battle, "some of these guys begin to change, and you begin to see some identification with their soldiers," says Berlin. Adj. Gen. Lorenzo Thomas, for example, had been a slaveholder in Delaware. But when Thomas saw the conditions under which his wounded troops were being housed at "Hospital No. 16" in Nashville, he shot off a blistering letter to the assistant surgeon general.

"Words of mine," he wrote, "cannot describe the utter filthiness of what I saw." One soldier with an amputated leg "was still in the dress in which he was carried from the battle-field, everything saturated with blood--and he complained that the lice were eating him up . . . Had these men been white soldiers, think you this would have been their condition? No! And yet the Black fell side by side of the White with their faces to the Foe . . . One man was cared for in every respect:--the other suffered in filth for weeks."

Thomas also urged the army command to promote one Col. Isaac F. Shepard to brigadier general, despite the criticism heaped on Shepard after he had ordered a white soldier whipped for abusing his black troops, and, to make matters worse, had had blacks do the whipping.

The "Freedom" project was initiated by the National Historical Publications and Records Commission in 1976, as part of a conscious effort to move away from "top-down" history toward "bottom-up" history--to take the same methods used in publishing the collected papers of the founding fathers and apply them to everyday American lives.

The work has involved up to five researchers at a time at an average annual cost of $60,000 to $70,000 over the six years since it began. Eventually, Berlin hopes to publish half a dozen or more volumes extending into the post-Civil War years, but that goal has been thrown into doubt by budget cuts at the National Archives. Only one more volume--on the destruction of slavery--is assured of funding. The series is to be published by Cambridge University Press. The first volume runs 852 pages, and has a list price of $37.50.