In 1529, Alauddin Riayat founded his first capital in Hujung Tanah, known as Pekan Tua, 11 km upriver from Kota Tinggi, following the death of his father. A river fort, Kota Kara was also founded down the river. In 1535, about 400 Portuguese troops led by Estêvão da Gama invaded Johor. Kota Kara was bombarded but the Malays withstood the attack. After a few days, Portuguese troops landed and bombarded the fort but they also had to retreat. Their morale boosted by this initial success, the Malays left their fort and launched a counter-attack on the Portuguese. However, the Malays were scattered by the crossfire of the Portuguese which resulted in the capturing of the fort and its burning by the Portuguese.