The 37-year-old professor was kidnapped along with three others last week in Sirte town of Libya - which is in the control of Islamic State - while on their way to the airport to take a flight home. They were in a taxi when they were stopped at the check-post.
All four worked at the university, which turned out to be their key to freedom.
Professor Ramakrishna and Vijay Kumar were recognized by former students who had joined the IS. Two others, Balram and Gopikrishna, remain in captivity.
"The captors were our students... some only 13-17 years old. I had even failed some of them but they treated us very well. Their sheikh (boss) told me the other two will be fine and there is nothing to worry about," he told reporters.
The IS reportedly gave their prisoners food and clothes before dropping them back.
Professor Ramakrishna said that his captors "admitted that kidnapping them was a mistake."
The kidnappers also gave him a special phone to call them, but it did not work.
"I have to convey a message in Arabic. I hope international channels will air it," he said. It turned out to be an appeal for the safe release of his friends who are still in captivity; their families had come to the airport to meet the professor.
"They told Lakshmikant that they will release the other two also," said Sreedevi, the wife of Balram.
Professor Ramakrishna arrived to a huge welcome from his family, who came from their hometown Raichur in Karnataka, five hours away.
He saw his daughter Kruthi for the first time today and was deeply moved.
"It is the happiest day of my life. Lakshmikant said she's the loveliest baby he has seen," the professor's wife Lakshmi told NDTV.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.