The deal caps the UK order from GSK at 34.8 million doses, including those already received. It follows the cancellation of a contract with Baxter in February which, unlike the GSK deal, included a break clause.
About 4.7 million doses of the vaccine had already been given to priority groups in England by the end of March.
Unused vaccine will be kept in reserve in case of a third outbreak, although the government will donate 3.8 million doses to the WHO to help in Africa.
The government will also continue to immunise remaining patients in priority groups who remain at risk from the virus.
The UK agreed to buy other GSK products as part of the cut-off deal, including the H5N1 'bird flu' and courses of the antiviral Relenza.
Health secretary Andy Burnham said: 'I am pleased we have reached an agreement that is good value for the taxpayer and means that the DoH has retained a strategic stockpile to protect the UK population without incurring a cancellation fee.'
Simon Jose, general manager of GSK UK, said the firm recognised that governments' needs had changed as understanding of H1N1 developed.
Mr Burnham said the probability of an H5N1 pandemic, likely to be more severe than swine flu, has not diminished.
'This agreement means we are ready if a bird flu pandemic occurred.'