Micheal Martin made the remarks as he attended the National Famine Commemoration in Strokestown Park, Co Roscommon on Sunday.
The state ceremony included military honours and a wreath laying ceremony by ambassadors to Ireland.
Mr Martin said there was no more traumatic or devastating event in the history of Ireland than the famine of the 1840s and 1850s.
“In a few short years Ireland saw an unimaginable loss of life and a dramatic escalation of emigration,” he said.
“An Gorta Mor changed who we were, who we are.
“Its indelible marks are still there in our culture, our society, our politics and our place in the wider world.
“As those terrible days become more distant from us they have receded as a defining part of our family stories, but their centrality to our national story remains as important as ever.”
The Taoiseach said Ukraine’s own national story had been scarred by experiences of famine.
“And of course, we are steadfast in our solidarity with the people of Ukraine as they defend themselves against a brutal and unjust war waged against them by a neo-imperial power,” he said.
Mr Martin added: “When the people of Ukraine voted for independence they did so in a spirit of self-reliance and without rancour.
“They chose for themselves a simple flag of a clear sky over fields of wheat.
“It was not an aggressive and exclusionary nationalism, but a nationalism which we and so many others can relate to.
“Ireland has opened its doors to the people of Ukraine at their time of need and that crisis has brought home the importance of those who can help others, doing whatever they can to aid those in dire straits.
“This too is reflective of what we know about those compassionate and generous individuals who did what they could to help the people of Ireland during the Great Famine.
“Those contributions and acts of kindness must never be forgotten.
“If we are to honour the victims of our Great Famine, if we are to be true to the spirit of trying to rid the curse of famine from our world, then we must be resolute in standing for cooperation between nations on the basis of humanitarian and democratic values.”
The Taoiseach said in 2022 the spectre of famine still haunted millions of people across the world.
“In Somalia alone, six million people are again affected by food insecurity only 10 years after 250,000 people, many of them children, died from hunger,” he said.
“Just as in the 1840s, the effects of drought are exacerbated by human action and inaction.
“Politics and ideology once again combine to increase the suffering of the poorest among us.
“As a people we know from our own bitter past that this is not just.
“The Irish people continue to be leaders in sending not just thoughts and prayers, but money, expertise and most importantly our people, be they missionaries, peacekeepers or the staff of our many NGOs to assist those experiencing the darkest of times.
“Through our participation in International bodies, such as the United Nations, we have sought to raise our voice in defence of the victims.”