<P> The name Agram was used in German in the Habsburg period; this name has been classified as "probably of Roman origin" but according to Desy (1990) it could be an Austrian German reanalysis of * Zugram . In Middle Latin and Modern Latin, Zagreb is known as Agranum (the name of an unrelated Arabian city in Strabo), Zagrabia or Mons Graecensis (also Mons Crecensis, in reference to Grič (Gradec)). </P> <P> In Croatian folk etymology, the name of the city has been derived from either the verb za - grab -, meaning "to scoop" or "to dig". One folk legend illustrating this derivation ties the name to a drought of the early 14th century, during which Augustin Kažotić (c. 1260--1323) is said to have dug a well which miraculously produced water . In another legend, a city governor is thirsty and orders a girl named Manda to "scoop" water from Manduševac well (nowadays a fountain in Ban Jelačić Square), using the imperative: zagrabi, Mando! ("Scoop, Manda!"). </P> <P> The oldest settlement located near today's Zagreb was a Roman town of Andautonia, now Šćitarjevo, which existed between the 1st and the 5th century AD . The first recorded appearance of the name Zagreb is dated to 1094, at which time the city existed as two different city centres: the smaller, eastern Kaptol, inhabited mainly by clergy and housing Zagreb Cathedral, and the larger, western Gradec, inhabited mainly by craftsmen and merchants . Gradec and Kaptol were united in 1851 by ban Josip Jelačić, who was credited for this, with the naming the main city square, Ban Jelačić Square in his honour . During the period of former Yugoslavia, Zagreb remained an important economic centre of the country, and was the second largest city . After Croatia declared independence from Yugoslavia, Zagreb was proclaimed its capital . </P> <P> The history of Zagreb dates as far back as 1094 A.D. when the Hungarian King Ladislaus, returning from his campaign against Croatia, founded a diocese . Alongside the bishop's see, the canonical settlement Kaptol developed north of Zagreb Cathedral, as did the fortified settlement Gradec on the neighbouring hill; the border between the two being the Medveščak stream . Today the latter is Zagreb's Upper Town (Gornji Grad) and is one of the best preserved urban nuclei in Croatia . Both settlements came under Tatar attack in 1242 . As a sign of gratitude for offering him a safe haven from the Tatars the Croatian and Hungarian King Bela IV bestowed Gradec with a Golden Bull, which offered its citizens exemption from county rule and autonomy, as well as its own judicial system . </P>

When did zagreb become the capital of croatia