Ireland will recognise a Palestinian state, its Prime Minister Simon Harris said on Wednesday, in a joint announcement with Oslo and Madrid.

"Today, Ireland, Norway and Spain are announcing that we recognise the state of Palestine," Harris said outside government buildings in Dublin.

"Each of us will now undertake whatever national steps are necessary to give effect to that decision," he added, calling it "an historic and important day for Ireland and for Palestine".

Like Norway and Spain, Ireland will recognise a Palestinian state from May 28, added Foreign Minister Micheal Martin.

Harris, who became prime minister last month after Leo Varadkar stepped down, drew parallels with the recognition of the Irish state in 1919.

"From our own history, we know what it means," he went on, referring to Ireland's declaration of independence from British rule, which eventually led to formal statehood.

"Recognition is an act of powerful and symbolic value," he told reporters, calling the three countries' moves "a statement of unequivocal support for a two-state solution".

A two-state solution, he said, was "the only credible path to peace and security for Israel, Palestine, and for their peoples."

Harris said the decision came against the backdrop of Israel's war with Hamas in Gaza.

But he drew a distinction between the militant group and ordinary Palestinians and said it did not threaten Ireland's recognition of Israeli statehood.

The Hamas attack on October 7 last year was "barbaric", he said, noting that an Irish-Israeli child was among those taken hostage.

"We call again for all hostages to be immediately returned to the arms of their loved ones," he said.

"But let me also be clear, Hamas is not the Palestinian people. Today's decision to recognise Palestine is taken to help create a peaceful future.

"A two-state solution is the only way out of the generational cycles of violence, retaliation and resentment...

"Just as Ireland's recognition as a state eventually led to the establishment of our now peaceful republic, we believe that Palestinian statehood will contribute to peace and to reconciliation in the Middle East."