Perak is the fourth largest state in the country. It borders Kedah at the north; Thai Yala Province to the northeast; Penang to the northwest; Kelantan and Pahang to the east; Selangor to the south, and the Straits of Malacca to the west. The state's administrative capital of Ipoh was known historically for tin-mining activities until the price of the metal dropped, severely affecting the state's economy. The royal capital, however remains at Kuala Kangsar, where the palace of the Sultan of Perak is located.