KATMANDU, Nepal—Fear of aftershocks sent thousands here into the streets and parks overnight, where they huddled under plastic tarps after a day during which soldiers and police dug, often by hand, in the rubble of collapsed buildings in a race to rescue survivors.

More than 3,200 people were confirmed dead after Saturday’s 7.8-magnitude quake—the Himalayan nation’s most devastating temblor in roughly 80 years—which rippled across a broad swath of Nepal, damaging the historic heart of Katmandu, flattening remote villages and...