Legislation providing for the granting of an amnesty and apology to Defence Forces members who fought with Allied forces during World War II passed all stages in the Dáil and Seanad today.

Minister for Justice Alan Shatter said the legislation would help make amends for the shameful way they were treated after World War II.

The Second World War Amnesty and Immunity Bill 2012 was brought in to recognise the courage and bravery of around 5,000 soldiers court-martialled or dismissed from the Defence Forces for absenting themselves without leave or permission.

After the war, many returned home to be branded deserters.

Speaking on RTÉ's Morning Ireland, Mr Shatter said it was time to acknowledge the contribution made by Irish soldiers who deserted to fight against the Nazis in WWII.

The head of a campaign to pardon Irish soldiers who deserted to fight with the Allied forces in WWII has welcomed the amnesty.

Peter Mulvany, co-ordinator of the Irish Soldiers Pardons Campaign, said the anticipated passage of the bill was a good day for the country.

Giving an example of what some soldiers faced when they returned to Ireland after the war ended in 1945, Mr Mulvany said that one Irish army deserter who was involved in the liberation of the Belsen concentration camp had to emigrate after struggling to find work.

The man only returned to Ireland a few years ago, Mr Mulvany said.

He said that the men were ostracised in their own communities and considered traitors when it was learned that they had served in the British Army.

Mr Shatter won praise from the Opposition this evening, with Fianna Fáil acknowledging that he could "take a bow" after introducing the legislation.

Party spokesman Seán Ó Fearghaíl welcomed the legislation, but said the penalties the men and women suffered may have been understandable at the time.

Sinn Féin's Pádraig Mac Lochlainn said that others who had fought fascism in the Spanish Civil War, who were excommunicated by the Catholic Church and isolated by society when they returned, should also be acknowledged.

Mr Shatter said today was an important day for the families of those involved.

He said it was a tribute to how far we had come as a society that such a sensitive issue could get practically unanimous support from all sides in the Dáil.

However, he also acknowledged the work done by those who had remained loyal to the Defence Forces.

He said those who served during the war had performed a crucial duty for the State at a key time in its history.