FREDERICKSBURG, Va. — The first bullet surfaced just after lunch. As Jon Tucker sifted soil through a screen in September, a corroded lead slug jiggled into view amid the sand and ash excavated from a pit just a few feet from a fenced-off sidewalk and rushing traffic.

Mr. Tucker waved to his supervisor, Taft Kiser, the lead archaeologist on the site, and held up the bullet for him to see. It would not be the last time. Hundreds of artifacts followed, along with the contours of a buried cellar holding a rich trove of Civil War history sealed since a ferocious 1862 battle in this Virginia city, which today lies just beyond the suburbs of Washington.

The discovery amid construction of a courthouse was unexpected. But the site has astonished historians and archaeologists for another reason: it represents a “time capsule,” in the words of Mr. Kiser, a rare snapshot in time, undisturbed through more than a century of urban construction around it.

Since then, the crew’s shovels and trowels have scraped away cinders and sand to reveal the basement’s contents: Dozens of bullets. Buttons from Union jackets. Shards from whiskey bottles. A metal plate from a cartridge box. Chinstrap buckles. Tobacco pipes. A brick fireplace and charred floorboards.