The Battle of Gannoruwa was a battle of the Sinhalese–Portuguese War fought in 1638 between the occupying Portuguese forces and the Sinhalese King's army at Gannoruwa in the District of Kandy, Sri Lanka. The Portuguese had attempted three times without success to capture the Kingdom of Kandy, in order to bring the entire country under their rule. In 1635, Rajasinghe II became the king of Kandy and started negotiations with the Dutch to obtain their help in driving out the Portuguese. The Portuguese hastened their efforts to take Kandy because of this, and Diogo de Melo de Castro, the Portuguese Captain General, tried to provoke the Sinhalese on several occasions.

Melo seized an elephant presented to a merchant by the king, to which the king responded by seizing two of Melo's own horses. Following this incident, Melo assembled his troops and set out for Kandy. The city of Kandy was evacuated by the Sinhalese, and Melo's army found the city empty when they arrived. They sacked and burned the city, and started to return to Colombo. However, their way forward was blocked by the Sinhalese army at Gannoruwa. The Portuguese force was surrounded with all escape routes cut off.

On 28 March 1638, the Sinhalese army attacked the Portuguese force, leaving only 33 Portuguese soldiers alive, along with a number of mercenaries. The heads of the killed soldiers were piled before the Sinhalese king. The battle, which ended in victory for the Sinhalese army, was the last battle fought between the Portuguese and the Sinhalese, and was also the final battle fought by the Kingdom of Kandy. The Portuguese were driven out of the country by the Dutch soon afterward.

BackgroundThe Portuguese first landed in Sri Lanka in 1505.The aim of the Portuguese was to capture the entire island which was split into several kingdoms. By 1619, they were in control of the kingdoms of Kotte, Sitawaka and Jaffna. Kandy was the only remaining kingdom under the native king's rule. The Portuguese attempted to capture Kandy in 1594, 1603 and 1630, but were defeated on all three occasions. In 1635, with the death of King Senarath, the kingdom was split into three parts. His son became the king of Kandy as Rajasinghe II, and Rajasinghe's cousins, Wijayapala and Kumarasinghe, were given control of the Matale and Uva areas. Rajasinghe, earlier known as Maha Asthana, had fought against the Portuguese at the Battle of Randeniwala along with his father and cousins in 1630. Rajasinghe II began negotiations with the Dutch to get their help in defeating the Portuguese. As a result of this, the Portuguese hastened their attempts to capture Kandy.Diogo de Melo de Castro was the Portuguese Captain General in Colombo, having been appointed to that position in 1633.

ProvocationsMelo followed an aggressive approach towards Kandy from the beginning. A caravan of 600 men and bulls was taken into custody and later released. He also raised issues with the peace accord that had been signed earlier between the Portuguese and King Senarath. In the meantime, he assembled his troops in preparation for an attack on Kandy. These troops later encamped in Atapitiya, close to the boundaries of the Kingdom of Kandy as a show of strength. In response to this, the Sinhalese strengthened their defences with troops from Matale and Uva.

Rajasinghe had presented an elephant to a Portuguese merchant, António Machado, who had gained the king's favour. Melo took this elephant into his possession. After hearing about this, Rajasinghe presented another elephant to the merchant. He then seized two horses that were sent to Kandy by Melo for sale, and informed Melo that the horses would be released upon the return of the elephant. The Portuguese also killed Rajasinghe's Disawe, a regional officer, of Batticaloa, much to the king's anger.

PreparationsMelo began preparing his troops to attack Kandy after the seizure of his horses by the Sinhalese king. He ordered his Disawes to summon the army to a village named Menikkadawara. On 19 March 1638, Melo departed from Colombo and arrived at Menikkadawara with an army of 900 Portuguese soldiers and 5000 mercenaries including Lascarins, Kaffirs, Malays, Canarese and some Sinhalese. Troops were also brought from Malacca for the battle. Rajasinghe sent a letter to Melo through a Portuguese friar seeking negotiations, but this call was rejected by Melo, who replied, saying "The little black is frightened. We shall drag him by the ears". The king, angered by this remark, summoned his troops and prepared for the battle. The Portuguese army was put under the command of Fernão de Mendonça Furtado, the nephew and son in law of Melo.

The city was evacuated, since the Sinhalese army was not capable of facing the Portuguese army head on. Everything of value in the city was taken away. Instead of facing the Portuguese directly, Rajasinghe and his generals planned a trap. The Sinhalese army encamped on Gannoruwa hill, preparing to attack the Portuguese force upon their return from Kandy.

The king's vowWhile reconnoitering with his generals in the area around a shrine called Dodanwala Devalaya, the king's crown fell from his head. He was informed by his men that he was near the Dodanwala Devalaya and that the deity presiding in the shrine was powerful. Rajasinghe vowed at the shrine that if he succeeded in defeating the Portuguese, he would present his crown and sword to the shrine.

BattleThe Portuguese force advanced through Atapitiya to Balana, a fort and observation post of the king's army. They proceeded to Kandy, and found the city deserted. They sacked and burned the city, including the royal palace and temples, and then withdrew, intending to return to Colombo.

They retreated towards Balana with the objective of entrenching themselves on the slopes of Kiriwat Talawa, but had only reached Gannoruwa by nightfall. The king's army was strengthened by Wijayapala's troops from Matale, and the combined Sinhalese army was also assisted by Indian soldiers and Moors. At Gannoruwa, Sinhalese woodmen cut down forest trees and obstructed the Portuguese path, preventing them from crossing the nearby Mahaweli river. The road back to Kandy was blocked by troops from Matale, and all escape routes were effectively cut off. The stragglers around the main force were killed by shooters hidden in the surrounding forests. On the following day, 28 March 1638, the Portuguese force tried to resume their retreat. Sinhalese army at once attacked the Lascarins carrying provisions and separated them from the main force. The Lascarins abandoned the provisions in order to retreat and rejoin the main force. Before the Portuguese troops could reach the high ground at Kiriwat Talawa, the Sinhalese army surrounded them and opened fire with their heavy guns, including jingals.

With the Portuguese force suffering heavy damages, Melo requested an armistice. Rajasinghe did not reply to this, but ordered his drummers to proclaim that all Sinhalese that were with the Portuguese force were to leave them. They were told that those who remained would be put to the sword the next day.

Numbers of the Portuguese force were rapidly reduced before the Sinhalese army charged up the hill and attacked them. Rajasinghe conducted his troops during the battle from under the shade of a tree. The Portuguese force was almost completely destroyed in the fight that ensued. Approximately 4000 soldiers of the Portuguese force were killed. Only 33 Portuguese soldiers were left alive, along with a number of mercenaries. Rajasinghe and Wijayapala ordered their men not to kill the survivors after the battle was won. Heads of the killed soldiers were piled before the Sinhalese king. A search was made for Melo's body, but it was not found. However, some Sinhalese soldiers found Melo's sword, and presented it to Rajasinghe.

AftermathAfter the victory, Rajasinghe presented his sword and crown to the Dodanwala Devala as he had vowed. Men who had taken part in the battle received positions and lands as rewards. The commanders who led the Sinhalese army in the battle were promoted to higher ranks. The Portuguese did not make any other attempts to take Kandy after this. The Battle of Gannoruwa was the last battle fought by the Kingdom of Kandy. It was also the last battle fought between the Portuguese and the Sinhalese.

Rajasinghe eventually made an agreement with the Dutch to drive the Portuguese from the country. As a result, the Portuguese were driven out by the Dutch in 1658. King Rajasinghe II later presented Melo's sword to a Dutch Admiral, Adam Westerwolt. The success of the Sinhalese army at the battle was later glorified in the poems Konstantinuhatane and Mahahatane.