The figure includes 3 million pounds for media facilities and 34,000 pounds for transporting the Popemobile.
The government was criticized earlier this month when it disclosed that 1.85 million pounds for the trip came from Britain's foreign aid budget.
The pontiff met British political and religious leaders and addressed large crowds in London, Scotland and central England during his four-day visit in September.
Foreign Office minister Henry Bellingham released the figures Wednesday and said the Catholic Church and the Scottish government were also contributing to the costs.
Police have not disclosed the security price tag.