Thousands of Irish soldiers who deserted their neutral nation's military to fight with the Allies in World War II will be officially pardoned under a new law set to be passed on Tuesday.

About 5,000 deserters were court martialled or dismissed from the Irish defence forces in 1945, a move that left them without military pensions and barred from any state job for seven years.

Defence Minister Alan Shatter formally apologised last year for the discharge order, known as the "starvation order" because of the devastating effect it had on ex-servicemen and their families.

On Tuesday, lawmakers were set to approve legislation enshrining this apology and an amnesty in law, in a move Shatter said "goes some way to right the wrongs of our past".

"The bill is being enacted in recognition of the courage and bravery of those individuals court martialed or dismissed from the defence forces who fought on the Allied side to protect decency and democracy during World War II," the minister said.

"It gives important statutory expression to the apology given by me on behalf of the state last year for the shameful manner in which they were treated."

He acknowledged that only a handful of those affected were still alive, but said the amnesty would restore their reputations and help their families find peace.

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

He said the ex-servicemen "were treated horrendously".

About 60,000 Irish people are thought to have fought in the British army, navy or air force during World War II, but tensions between London and Dublin over British-controlled Northern Ireland meant their efforts were for decades virtually forgotten.

Since the landmark 1998 Good Friday peace deal in Belfast, however, recognition of their role has become a powerful symbol of reconciliation between the neighbouring countries.

During her historic visit to Ireland in 2011, Britain's Queen Elizabeth II laid a wreath at a Dublin memorial to those who died in both World Wars.

Shatter told RTE radio that the amnesty law was "an important additional brick in the wall of reconciliation".

"For too long their story has been airbrushed out of our history and it is time we acknowledged it and we paid respect to them for the contribution they made," he said.

He added that the Irish deserters who helped stopped the Nazi advance across Europe had helped save their own country.

"There can be very little doubt that had Germany successfully invaded Great Britain, that Ireland was next on the list," he said.