Latvia took the lead in the first period and held it until the end in a gritty and well-disciplined display.
It is the first time a Latvian team has reached the last 8 at the world championship since 2009.
State president Raimonds Vējonis was among the first to tweet his congratulations on the result.
Apsveicu Latvijas hokeja izlasi ar teicamo sasniegumu! Komandas gars,pašatdeve un skaidrs mērķis. Malači! #hokejs2018— Raimonds Vējonis (@Vejonis) May 15, 2018