RIGA—Latvian Prime Minister Valdis Dombrovskis resigned Wednesday in a surprise move intended to shoulder some responsibility for the collapse of a supermarket last week that killed 54 people and raised questions about government oversight at a critical point in the nation's history.

During his four-year tenure, Mr. Dombrovskis, 42, relied on a series of painful austerity measures to pull the small Baltic nation's economy out of crisis. His government will now begin preparing to leave office five weeks ahead of Latvia's admission...