The future of the Post Office network has been secured thanks to new funding of £370 million to help protect village branches and modernise others, the Government has announced.
The three-year funding agreement, to run from next April, comes as the Post Office moved into profit for the first time in 16 years, making £13 million in the last financial year.
Around £210 million will be invested in continuing to modernise the network, while £160 million will help protect smaller branches such as those in villages.
The Government said it had invested more than £2 billion since 2010, leaving a network of around 11,600 branches, extended opening hours and thousands of branches open on a Sunday.
Business Secretary Greg Clark said: "The Post Office is at the heart of communities across the UK, with millions of customers and small businesses relying on their local branch every day to access a wide range of important services.
"With the network at its most stable in decades, this £370 million of Government funding will ensure it can continue to modernise and bring further benefits to customers across the UK."
Paula Vennells, chief executive of the Post Office said: "Making a profit for the first time in 16 years is a major milestone in the Post Office's journey to a sustainable and successful business.
"We're fulfilling the promises we have made, and this is recognised by the Government's further investment in the Post Office, which will enable us to continue transforming the business to meet our customers' changing needs - a transformation that has already seen us make significant progress.
"We are committed to making the Post Office matter as much tomorrow as it does today. For over 370 years, the Post Office has stayed relevant to communities the length and breadth of the UK by changing and adapting.
"With the Post Office now trading at a profit, we are better placed than ever to embrace the future."
A spokesman for the Communication Workers Union said: "While the Post Office and Government are dressing this up as good news, in reality the Post Office is facing a significant cut in Government funding for the next three years.
"The CWU wants to see a profitable and successful Post Office, but its financial results have been delivered on the back of closures, thousands of job losses and huge reductions in income for subpostmasters.
"The announcement marks a continuation of this strategy and is bad news for communities that rely on post offices across the country. Far from modernising the network this is managing its decline."
Unite officer Brian Scott said there should be greater clarity on how the profit has been achieved.
"Unite believes that the Post Office lacks a coherent strategy for the future and that much of its 'success' has been achieved through a slash-and-burn approach to jobs and the diminution in quality of customer experience.
"Post offices have been franchised and its relevance in the High Street is being undermined and this trend has to be challenged."
Rebecca Long-Bailey, the shadow business secretary, said: "Despite the rhetoric, today's announcement is actually a significant year-on-year cut in Government funding for the Post Office.
"The Conservatives' claims about modernisation are code for closures, job losses and pay cuts."