Founded in the 12th century by King Ananda Malla (according to various chronicles), Bhaktapur was the capital city of the Greater Malla Kingdom until the 15th century and was an independent kingdom from then until the 18th century.
The last three Malla rulers of Bhaktapur were Jitamitra Malla, Bhupatindra Malla, and Ranjit Malla. These rulers played key roles in building the palaces and temples of Durbar Square. In 1744, Prithvi Narayan Shah, descendent of Dravya Shah, who was the founder of the Gorkha dynasty, began a conquest march in the Kathmandu Valley, capturing and unifying Kathmandu, Patan, Bhaktapur, and the smaller towns of the Valley under one rule.
After a period of instability and a bloody coup in 1846, Jang Bahadur Kunwar Ranaji took control of Nepal. His Rana dynasty ruled Nepal until 1951, when the Congress Party formed a new government. In 1960, King Mahendra took control, banned political parties, and instituted land reforms. Political turmoil continued throughout the late 20th century. In 1934, a major earthquake destroyed over 2,000 houses and severely damaged over 2,000 more homes. Over 1,000 people died in this quake. Restoration of many buildings was undertaken over the years, including efforts funded by West Germany in the late 1980s and by the U.S. in the 1990s. Visit Patan.com for more information on the history of Nepal.