Beijing is the capital of the most populous country in the world, China, and its second largest city after Shanghai. It was the seat of the Ming and Qing dynasty emperors until the formation of a republic in 1911. Beijing is the political, educational and cultural center of the country and as such it is rich in historical sites and important government and cultural institutions.