One of the world's most dramatic wildlife rescues is coming to a successful conclusion on Tristan da Cunha in the South Atlantic. Thousands of endangered northern rockhopper penguins, which were caught in thick oil slicks, have been saved in a month-long operation involving virtually all of the islands' 260 inhabitants.

The penguins were trapped in oil released by the freighter MV Oliva when it ran aground and broke up last month off Nightingale island, 20 miles from the main island of Tristan da Cunha. Thousands of these delicately feathered birds – known locally as pinnamins – were coated in thick oil and all would have died but for the extraordinary intervention of local people.

"Just about everyone on the island has played a part in this operation," Katrine Herian, an RSPB project officer based on the island, said. "It was an amazing, co-operative effort. Some people took boats to Nightingale to pick up oiled penguins – a very tricky task given the swells and winds there. Carpenters on the main island built pens to keep them in. The main store – where tools, cement and machinery are stored – was cleared out and sand put down on the concrete floor so we could keep the penguins there.

"Then the island's swimming pool was drained of nearly all its water and used as a home for cleaned birds. People even ransacked their freezers to find fish they could thaw out and use to feed the rockhoppers. They would have starved otherwise." In the end, about 4,000 rockhoppers were saved, although Herian warned that it was impossible to say how many others may have died: "We won't really know until next year when the birds start breeding again and we can get a proper chance to count numbers and see how badly they were affected."

The northern rockhopper penguin, Eudyptes moseleyi, is found on only a few islands in the Atlantic, with 99% of its population making homes on the British overseas territory of Tristan da Cunha, a lonely, volcanic archipelago considered to be the world's most remote inhabited group of islands. There is no airstrip and the nearest major ports are in South Africa.

Keeping track of the northern rockhoppers in such a location is not easy. Nevertheless, ornithologists have discovered that their numbers have plunged by more than 90% since the 1950s, with factors such as climate change and over-fishing of squid and octopus – the penguins' main source of food – being put forward as possible causes. As a result, the northern rockhopper is now classified as an endangered species. The wrecking of the MV Oliva, therefore, posed a significant threat to them. The ship was carrying 65,000 tonnes of soya beans from Brazil to China when it ran aground on 16 March on an islet off Nightingale island. All 20 crewmen were rescued by islanders, but the vessel broke apart and released more than 1,500 tonnes of oil on to the waters around the island, coating the rockhoppers.

Within a day, islanders and RSPB workers began their remarkable rescue operation. When winds and the swell were low, they sailed to the island in small boats and, using Tristan's principal fishing vessel, the Edinburgh, as a command vessel, began shipping oiled rockhoppers back to the main island.

"The birds get very distressed when they are coated in oil," said Herian. "They lose body temperature very quickly in the water and preen themselves to get rid of the oil. They get weaker and weaker as they do that. Unless they get help, they die."

Capturing the birds as quickly as possible became a priority. Then they were transported to the main island, where they were corralled in pens, then showered and soaped to get rid of the oil and given liquid glucose feeds that vets usually give to pet cats and dogs to provide them with a quick energy boost. Then they were dried off under infra-red lamps.

"Many of the islands' older inhabitants played a key role in this work," said Herian. "These are remarkably hardy people and pensioners think nothing of walking many miles every day to get about. They did a lot of the hard work in cleaning up the penguins."

The local rescue mission was also given crucial support from a team from Sanccob, the Southern African Foundation for the Conservation of Coastal Birds, which arrived on the island on 5 April. They brought specialist cleaning equipment, vitamins – and 20 tonnes of frozen pilchards. The Sanccob team also installed three large hot-water geysers in the wash-bay to improve penguin-washing, as well as hundreds of metres of piping and cable to link to the island's water and electrical supplies. In the end, a complex routine was established. Workers sprayed a fine mist of de-greasing agent over stricken penguins. Then the birds were washed in a warm bath of biodegradable soap and an antiseptic solution before being given a gentle clean round their eyes using a toothbrush. Later the rockhoppers were moved to the islanders' swimming pool so that their swimming skills could be assessed. Those that passed the test were released into the Atlantic.

"We will know next year how successful this operation has been when we count how many breeding pairs have returned to Tristan," said Herian.