"It is a mistake we must never repeat. If so, we will suffer," he told a forum on global terrorism organised by Shippers’ Academy - Colombo at the Ceylon Chamber of Commerce.
Gunaratna, who heads the university's International Centre for Political Violence and Terrorism Research, said Sri Lanka risks alienating India if the island gets too close to China.
"India punished Sri Lanka then. I have no doubt India will once again punish Sri Lanka if we flirt with China at the cost of India," Gunaratna said.
Sri Lanka could continue to get economic assistance from China but not "at the cost of India," Gunaratna said.
China became Sri Lanka's main supplier of weapons during the ethnic war and is now a key source of aid and investment, helping to build a port and an airport, power plants and roads and railways in the island.
Gunaratna warned that if India sees Sri Lanka as hostile Indian intelligence services could once again train and nurture terrorist groups to destabilise the island as it did in the early 1980s by helping Tamil separatists.
In the initial phases of the ethnic war, Tamil separatists operated out of bases in the south Indian state of Tamil Nadu, using small, fast boats to cross the narrow strip of water separating the two countries for attacks.
That was a time when Sri Lankan political leaders were "very Western oriented" with the island being the first to adopt free market economic policies in the south Asian region, Gunaratna said.
He said Indian support was crucial in the final stages of the war which ended in May 2009 when Sri Lanka came under pressure from Western powers to stop its military campaign on the verge of victory over the Tigers.
"India is the only country which could have stopped the military advance which ultimately defeated the Tamil Tigers," he said, noting that this was made possible by good relations developed by Sri Lanka's government with India.
"If we antagonise India, India will punish us," Gunaratna warned. "India has done it to several other countries."He referred to how India is seen to have supported violent groups in Pakistan and Bangladesh as well as in Sri Lanka.