Skyscrapers have pierced the air for over 150 years, but occasionally these huge structures are no longer wanted, and have to be replaced. How do you set about such a job?

They soar high above the world's cities, glittering symbols of mankind's power and wealth.

But sometimes what goes up has to come down.

When they are damaged, or fall out of favour, or outlive their original purpose, very tall buildings occasionally have to be flattened.

But doing so is an extremely tricky task - and as skyscrapers rise higher and higher each year, the task of bringing them back down becomes increasingly complicated.

Almost everyone has seen spectacular footage of towers being blown up with explosives.

The knack of getting an edifice to collapse on to itself - known as implosion - is a highly skilled specialism.

In the kind of densely-built areas where high buildings tend to proliferate, however, such demolitions are not generally permitted.

As a result, engineers have had to come up with increasingly innovative ways of felling tall structures.

Tallest demolished buildings Singer Building, New York, 1968 - 614 ft (187 m)

City Investing Building, New York, 1968 - 487 ft (148 m)

Morrison Hotel, Chicago, 1965 - 526 ft (160 m)

"There's an art and a science to it," says Michael Taylor, executive director of the National Demolition Association, which represents US contractors and specialists in the industry.

One of the more elaborate techniques, pioneered in 2008 by Japanese construction firm Kajima, involves knocking out the bottom floor and lowering the structures above it on computer-controlled hydraulic jacks. Stop-motion footage of the system makes it look as though a 20-storey building is sinking into the ground.

Developers may have to think even more creatively in the future. The world's tallest skyscraper, the Burj Khalifa in Dubai, is at 2,722ft (829m) vastly taller than anything that has been levelled before.

The highest-reaching tower to be peacefully demolished was the 47-storey, 612ft (187m) Singer building in New York, which was taken down manually between 1967 and 1968.

How exactly someone would go about dismantling the new breed of "mega-tall" structures like the Burj Khalifa is unclear.

Image caption The 15-floor P&O building in the City of London was demolished from the bottom up

"The short answer is that we don't know," says Antony Wood, executive director of the Council on Tall Buildings and Urban Habitat.

However, demolition experts have extensive experience of taking apart edifices of an earlier vintage. At present, buildings in closely-packed downtown urban districts tend to be dismantled manually.

There are a number of ways to do it.

One method involves the team of engineers dismantling the building top to bottom, floor by floor. However, fire or structural damage might render this unsafe.

Instead, the demolition crew could use a high-reach mechanical excavator with a long arm to pull down the upper storeys. After the New Zealand earthquakes of 2010 and 2011, a 65m (213 ft) device of this kind nicknamed "Twinkle Toes" was imported from the UK to pull down damaged high-rises in Christchurch.

Alternatively, if the exterior wall is a "curtain" - that is, it is not part of the structure, but forms an outer covering, typically made of glass - it can be pulled inside the structure using a crane, once the interior has been gutted.

In some cities, however, it may still be permitted to blow the building up.

The term implosion is something of a misnomer. In fact, the technique involves strategically placing explosive charges to remove a building's support structure so that it collapses on itself, causing as little damage to its surroundings as possible.

The results are quick - typically, an implosion takes eight seconds - and spectacular.

Image caption The Three Gorges Hotel and a passenger terminal are imploded in Chongqing, China

Footage of such operations - such as that to take down the 29-floor JL Hudson department store in Detroit, Michigan, the largest building ever to be imploded - make compelling viewing.

However, carrying out such a demolition involves painstaking preparation. It can take up to six months to survey the structure and prepare it for the blast by removing non-load bearing walls, weakening support structures and fitting the charges. Clearing up debris afterwards can take up to two months.

Also, the results can be disastrous if something goes wrong. In 1997 nine people were injured and a 12-year-old girl was killed by flying masonry during the demolition of the Royal Canberra Hospital in Australia.

When carried out correctly, these demolitions can be achieved with a high degree of accuracy. According to Taylor, the 1991 implosion of Orlando City Hall - which featured in the film Lethal Weapon 3 - was achieved without breaking a single window on an adjacent building 4ft away.

The symbolism of blowing something up in front of large crowds of onlookers has regularly been harnessed by politicians and developers - particularly in the case of unpopular high-rise public housing projects, Taylor believes.

"Let's not forget the political effect of it," he says.

"They were saying to the country, 'This was a failed public strategy. We are changing.'"

Partly for this reason, implosions tend to occur in areas of urban deprivation.

However, remarkably few skyscrapers in places like Manhattan and Chicago - where the first such multi-storey structures sprung up - have been dismantled, despite them having been with us since the late 19th Century.

Image caption The Windsor Tower in Madrid, Spain, demolished after a fire in 2005

According to Carol Willis, curator of the Skyscraper Museum in New York, there is a good economic reason for this.

In the early days of high-rise construction there were few planning regulations, she says. In her city this changed in 1916 and again in 1961 with the introduction of limits on floor areas.

So anything built on the site of an early skyscraper which had been demolished would be smaller and thus less valuable.

"So you don't take skyscrapers down," she says. "You refit or repurpose them."

Some of these retro-fittings have made quite a difference.

In 2007, 10 years after it initially went up, engineers began adding an additional 24 levels to the 33-storey Blue Cross Blue Shield Tower in Chicago.

France's tallest building, the Tour First in Paris, had an additional 66m (216ft) added to its height in a refit completed in 2011.

The problem is that no-one really knows what the life expectancy of a tall building is, says Wood, whose organisation has launched a study into the subject.

But his personal belief is that there is no reason why skyscrapers cannot be re-fitted indefinitely.

"They need to be designed to be never taken down, such that their life cycle is as close to forever as you can get," he says.

"No-one's talking about when the pyramids are going to come down."

If that's possible, skyscrapers would truly defy gravity. What goes up doesn't necessarily have to come down.

You can follow the Magazine on Twitter and on Facebook