The Office for Budget Responsibility (OBR) warned the UK's ageing population was squeezing public finances and said there was "clear evidence" that migrants, who tend to be working age, have a "positive effect on the public sector's debt dynamics".
Increasing pensioner numbers and a strained healthcare system means an extra £19 billion of spending cuts or tax hikes are needed to combat an "unsustainable" pressure on the nation's public finances short term, according to the organisation.
It said the Government would need to find the additional savings in the year to April 2019 on top of the current £153 billion in austerity measures to get debt down to 40% of economic output.
If no action is taken, the burden of an ageing population in terms of pensions and healthcare will wipe out much of Chancellor George Osborne's spending cuts, leaving the UK with a £65 billion hole in its finances, according to the OBR.
The report predicts, however, that the debt would be nearly double that without net migration to improve public finances. Under an annual flow of 140,000 migrants from 2016 the public sector net debt to GDP ratio would reach 99% by 2063 but that would soar to 174% if there was a complete block on immigration.
The OBR report adds: "Our sensitivity analysis shows that overall migration has a positive impact on the sustainability of the public finances over our 50 year horizon. Under our central assumption of 140,000 annual net inward migration from 2016 the public sector net debt to GDP ratio reaches 99% by 2062-63, while assuming zero gross migration increases the net debt to GDP ratio to over 174%.
"These results are driven by the assumed age structure of net migration, which tends to be more concentrated in the working age group and hence reduces the dependency ratio throughout the projection period."
The OBR said the move to a single-tier state pension had slightly eased the pressure on public sector debt, but added that spending on healthcare was the biggest spending pressure over the next 50 years. It said the cost of the state pension was predicted to rise from 5.8% of GDP to 8.4% of GDP as the population ages, even with the introduction of the new flat rate payment system and increase in retirement age to 67 taken into account.