Before then, the city was known as Ungvár, also spelled Ongvár, Hungvár, and Unguyvar, a name derived from "Ung", the Hungarian name for the Uzh (as well as the surrounding county) and "vár", meaning "castle, fort".