The Kathmandu valley's visible history is inextricably entangled with the Malla kings. It was during their reign, particularly in the 1600s and 1700s, that many of the valley's finest temples and palaces were built. Competition between the cities was intense and an architectural innovation in one place would inevitably be copied throughout the valley.
The unification of Nepal in 1768 by Gorkha's King Prithvi Narayan Shah signalled the end of the Kathmandu Valley's fragmentation. Nepali, an Indo-European language spoken by the Khas of western Nepal, replaced Newari as the country's language of administration. In 1816 the Shahs closed the borders of Nepal and kept the country isolated until the mid 20th century. In 1846 a bloody massacre of Kathmandu's 100 most powerful men, held in the very public forum of Durbar Square, ended the Shah dynasty and installed the Ranas.
The Ranas weren't too taken with the Shahs' policy of isolation, and the first Rana maharaja set off for Europe with a huge entourage, visiting Queen Victoria and causing quite a stir in stuffy old England. The Ranas were so impressed with European architecture that they began introducing neo-classical buildings into their own cities, including the 1904 Singha Durbar. The Ranas began dressing like European royalty, and imported all the latest inventions which, strangely enough, never found their way beyond the royal compounds into the homes of ordinary folk. During this period of royal extranvance, the majority of people in Kathmandu became much poorer and the Hindu caste system became much more rigid - on the other hand, human sacrifice and slaveryi were abolished.
On 15 January 1934 a huge earthquake struck the Kathmandu Valley, killing 4296 people and destroying many of Kathmandu's temples and palaces. Inspired by the independence movement in India, Nepalis began a political upheaval - an alliance was formed between the ousted Shahs, the army's Gurkha regiments and the dissatisfied poorer extended families of the Rana clan. In November 1950 they revolted. King Tribhuvan, a Shah, was anointed ruler in 1951 and struck up a government comprised of Ranas and members of the newly formed Nepali Congress Party. Power, of course, remained with only one party - the king's. After months of uprisings, the Nepali people were finally granted democracy in 1989.
In 1956, the first motorable road linked Kathmandu with India. Ten years later another highway opened, and in 1974 international air services began. Foreign aid began pouring in from the 1960s, bringing with it foreign aid workers and new prosperity for the city. Kathmandu's population tripled in 20 years, and the city sprawled, as modern houses sprang up to meet the needs of ex-pats and immigrants poured in from the country. In the 60s, the tourists also started flooding in, looking for cheap living and eastern answers to the questions of life. Freak St became the centre of the action, as the hippies set up a huge market for every type of drug, every hybrid philosophy and any kind of pie in the sky philosphy you could imagine. Kathmandu was transformed into a tourist Mecca, and the jumping-off point for the new trekking industry into the Himilayas.