The full extent of the destruction of Britain's colonial government records during the retreat from empire was disclosed on Thursday with the declassification of a small part of the Foreign Office's vast secret archive.

Fifty-year-old documents that have finally been transferred to the National Archive show that bonfires were built behind diplomatic missions across the globe as the purge – codenamed Operation Legacy – accompanied the handover of each colony.

The declassified documents include copies of an instruction issued in 1961 by Iain Macleod, colonial secretary, that post-independence governments should not be handed any material that "might embarrass Her Majesty's [the] government", that could "embarrass members of the police, military forces, public servants or others eg police informers", that might betray intelligence sources, or that might "be used unethically by ministers in the successor government".

In Northern Rhodesia, colonial officials were issued with further orders to destroy "all papers which are likely to be interpreted, either reasonably or by malice, as indicating racial prejudice or religious bias on the part of Her Majesty's government".

Detailed instructions were issued over methods of destruction, in order to erase all evidence of the purge. When documents were burned, "the waste should be reduced to ash and the ashes broken up", while any that were being dumped at sea must be "packed in weighted crates and dumped in very deep and current-free water at maximum practicable distance from the coast".

Also among the documents declassified on Friday are "destruction certificates" sent to London by colonial officials as proof that they were performing their duties, and letters and memoranda that showed that some were struggling to complete their huge task before the colonies gained their independence. Officials in more than one colony warned London that they feared they would be "celebrating Independence Day with smoke".

An elaborate and at times confusing classification system was introduced, in addition to the secret/top secret classifications, to protect papers that were to be destroyed or shipped to the UK. Officials were often granted or refused security clearance on the grounds of ethnicity.

Documents marked "Guard", for example, could be disclosed to non-British officials as long as if they were from the "Old Commonwealth" – Australia, New Zealand, South Africa or Canada.

Those classified as "Watch", and stamped with a red letter W, were to be removed from the country or destroyed. Steps were taken to ensure post-colonial governments would not learn that such files had ever existed, with one instruction stating: "The legacy files must leave no reference to watch material. Indeed, the very existence of the watch series, though it may be guessed at, should never be revealed." Officials were warned to keep their W stamps locked away.

The marking "DG" was said to be an abbreviation of deputy governor, but in fact was a protective code word to indicate that papers so marked were for sight by "British officers of European descent only".

As colonies passed into a transitional phase before full independence, with British civil servants working for local government ministers, an entire parallel series of documents marked Personal were created. "Personal" files could be seen only by British governors and their British aides, a system that appears to have been employed in every territory from which the British withdrew after 1961. "The existence of the 'Personal' series of correspondence must of course be scrupulously protected and no documents in this series should be transferred to ministers," colonial officials were warned.

While thousands of files were returned to London during the process of decolonisation, it is now clear that countless numbers of documents were destroyed. "Emphasis is placed upon destruction," colonial officials in Kenya were told.

Officials in Aden were told to start burning in 1966, a full 12 months before the eventual British withdrawal. "It may seem a bit early to start talking about the disposal of documents prior to independence, but the sifting of documents is a considerable task and you may like to start thinking about it now."

As in many colonies, a three-man committee – comprising two senior administrators and one police special branch officer – decided what would be destroyed and what would be removed to London. The paucity of Aden documentation so far declassified may suggest that the committee decided that most files should be destroyed.

In Belize, colonial administrators officials told London in October 1962 that a visiting MI5 officer had decided that all sensitive files should be destroyed by fire: "In this he was assisted by the Royal Navy and several gallons of petrol."

In British Guiana, a shortage of "British officers of European descent" resulted in the "hot and heavy" task falling to two secretaries, using a fire in an oil drum in the grounds of Government House. Eventually the army agreed to lend a hand.

The declassified papers show colonial officials asking for further advice about what should and should not be destroyed. In 1963, for example, an official in Malta asked London for advice about which files should be "spirited away out of the country", and warned that while some documents could be handed over to the new government: "There may again be others which could be given to them if they were doctored first; and there may be files which cannot be given to them under any circumstances."

In June 1966, Max Webber, the high commissioner in Brunei, asked Bernard Cheeseman, chief librarian at the Commonwealth Relations Office, for advice about 60 boxes of files. "My Dear Cheese," he wrote, "can I, off my own bat, destroy some of these papers, or should the whole lot be sent home for weeding or retention in your records?"

Not all sensitive documents were destroyed. Large amounts were transferred to London, and held in Foreign Office archives. Colonial officials were told that crates of documents sent back to the UK by sea could be entrusted only to the "care of a British ship's master on a British ship".

For example, Robert Turner, the chief secretary of the British protectorate of North Borneo, wrote to the Colonial Office library in August 1963, a few weeks before independence, saying his subordinate's monthly reports – "which would be unsuitable for the eyes of local ministers" – would be saved and sent to London, rather than destroyed. "I ... have been prevailed upon to do so on the grounds that some at least of their contents may come in handy when some future Gibbon is doing research work for his 'Decline and Fall of the British Empire'."

Those papers that were returned to London were not open to historians, however. The declassified documents made available Friday at the National Archives at Kew, south-west London, are from a cache of 8,800 of colonial-era files that the Foreign Office held for decades, in breach of the 30-years rule of the Public Records Acts and in effect beyond the reach of the Freedom of Information Act. They were stored behind barbed-wire fences at Hanslope Park, Buckinghamshire, a government communications research centre north of London, a facility that it operates along with MI6 and MI5.

The Foreign Office was forced eventually to admit to the existence of the hidden files during high court proceedings brought by a group of elderly Kenyans who were suing the government over the mistreatment they suffered while imprisoned during the 1950s Mau Mau insurgency.

Even then, however, the Foreign Office failed to acknowledge that the 8,800 colonial files were just a small part of a secret archive of 1.2m files that it called the Special Collections, and which it had held unlawfully at Hanslope Park.

The Foreign Office is understood to have presented a plan to the National Archive earlier this month for the belated transfer of the Special Collections into the public domain. On Thursday it declined to disclose details of that plan.

The newly declassified documents show that the practice of destroying papers rather than allowing them to fall into the hands of post-independence governments pre-dated Macleod's 1961 instructions.

A British colonial official in Malaya reported that in August 1957, for example, "five lorry loads of papers … were driven down to the naval base at Singapore, and destroyed in the Navy's splendid incinerator there. The Army supplied the lorries (civilian type) and laid on Field Security Personnel to move the files. Considerable pains were nevertheless taken to carry out the operations discreetly, partly to avoid exacerbating relationships between the British government and those Malayans who might not have been so understanding ... and partly to avoid comment by the press (who I understand greatly enjoyed themselves with the pall of smoke which hung over Delhi during the mass destruction of documents in 1947)."

A few years later, colonial officials in Kenya were urged not to follow the Malayan example: "It is better for too much, rather than too little, to be sent home – the wholesale destruction, as in Malaya, should not be repeated."

• This article was amended on 29 November 2013 to replace part of a sentence that had been accidentally deleted during the editing process.