The Post Office Card Account is used by more than four million people
The Post Office will continue to run the card account which distributes benefits to 4.3 million claimants.
It had faced competition for running the Post Office Card Account from a private firm, but ministers have decided to close the bidding process.
Work and Pensions Secretary James Purnell told MPs he would do "nothing to put the network at risk".
The National Federation of Sub Post Masters had warned 3,000 post offices would close if the contract was lost.
The account was brought in to end the need for giros and payment books for pensioners and benefit claimants, while still allowing them to use post offices to collect money.
The Post Office had faced competition to run it from the private company PayPoint, which said it was "disappointed by this decision".
Mr Purnell's announcement comes two weeks earlier than expected after criticism from MPs that delays in deciding whether the Post Office would retain the contract were "destabilising".
He said the account was "central to the viability of the network" and said the next contract would run initially from April 2010 to March 2015 with "the possibility of an extension beyond that".
Mr Purnell added that PayPoint would be "compensated their reasonable costs".
But some lawyers have expressed concerns over possible legal action resulting from the decision and a EU investigation into how the process to re-award the contract was conducted.
Mr Purnell denied the matter had been mishandled, telling BBC Radio 4's PM: "The circumstances have changed because of the current financial situation. It means that people are even more reliant on the Post Office than before.
"It's a social service which people look forward to visiting. It is often at the heart of local communities. We can't ignore the fact that the world has been changing."
John McFall, chairman of the Treasury Select Committee, said the government could be "accused of prevaricating" over the contract, having felt "obliged" to put it out to tender.
But he said ministers had now "made up their minds very firmly" about the importance of the Post Office's social role and must ensure it became a strong financial provider in its own right.
Unions representing postal staff welcomed the decision but said the network's future depended on it being able to offer more services, particularly savings and insurance products.
"The Post Office is a national treasure and asset and the government should be doing more," said Andy Fury, from the Communications Workers Union, adding that the Post Office should be transformed into the "people's bank".
For the Conservatives, shadow business secretary Alan Duncan said the announcement was a "humiliating climbdown for the government, who have done everything they possibly can to find a way of awarding it (the contract) to somebody else".
The Lib Dems said the decision would come as a "huge relief" to postal workers and customers but argued ministers had "some explaining" to do about how it had handled the process.
"The government has wasted time and money and caused immeasurable heartache by dragging this process out for so long," said the party's work and pensions spokeswoman Jenny Willott.
"This could all have been avoided if, as the Liberal Democrats have long argued, the Post Office Card Account had never been put out to tender in the first place."
Earlier, Business Secretary Lord Mandelson told peers: "I believe very strongly that we have an opportunity here for the future of the Post Office - one that has been enlarged by the turbulence elsewhere in the financial services sector."
He said the government's closure programme, which will see 2,500 branches shut down by the end of year, had not been painless but "had placed the entire network on a much firmer footing".