In 1242 both parts of the city were attacked by the Tartars. As a sign of gratitude for liberation from the Tatar yoke Croatian and Hungarian King Bela iv bestowed Grades and offered its citizens exemption county laws and autonomy. After this started happening confrontation between the Zagreb diocese and the free upper town Grades, shared land and factories. The term Zagreb was used for these two separate campuses in The 16th century. Zagreb at that time served as the political center of Croatia Slaven.
In 1850 the city was united under the rule of the first mayor – Janko Kamauf. In the 17th century. Zagreb was chosen to host Croatian viceroys. At the invitation Croatian Parliament the Jesuits came to Zagreb and built the first high school. In 1669 they founded the university, where pripodovalis philosophy, theology. During the 17th and 18th centuries Zagreb was badly devastated by fire and plague. In the 19th century Zagreb was the center of the Croatian national revival.
He witnessed the construction of many cultural and historic buildings. The first railway line that connects Zagreb with Zidiani and Sisak was opened in 1862, and in 1863 Zagreb received a gasworks. The Zagreb waterworks was opened in 1878 and the first horse-drawn trams began to be used in 1891. The plant was established in 1907, and was developed in 1880-1914 after the earthquake Zagreb. The first half of the 20th century otlechilas large expansion of Zagreb. In the 1920's the population of Zagreb, has increased by 70 percent – the largest demographic boom in the history of Zagreb.