Should the ravens leave the Tower of London, the tower will crumble and fall — and the kingdom with it. Or so the legend says. And the kingdom had a rather close call recently.

Eight-year-old Porsha, one in a long line of ravens that have lived at the Tower of London since the 17th century, had a congenital heart condition.

"Unfortunately, about a month ago, it just got the better of her and sadly we had to say goodbye to her," says Chris Skaife, the tower's resident ravenmaster, failing to hide his lingering sadness.

Thankfully for Britain, Skaife always keeps a bird waiting in the wings — just in case. That spare raven is now filling the late Porsha's role as guardian of the kingdom until her permanent replacement arrives next month.

Legendary status

The Tower of London is one of the city's most recognizable attractions, with its sprawling green grounds, majestic White Tower, neatly dressed Beefeaters and Crown jewels.

But it is the ravens that really run the show.

BRITAIN-REMEMBRANCE/

A raven flies over a poppy-themed art installation at the Tower of London in this Sept. 19, 2014 file photo. (Russell Boyce/Reuters)

Two ravens at Tower of London

Ravens Muninn and Jubilee are the oldest and youngest birds at the Tower of London. (Jacqueline/For CBC News)

They are specifically bred for lifetime duty at the tower, keeping Britain safe from harm — a role held by a select six-pack of the black birds since the deeply superstitious King Charles II ordered it during his reign in the 1660s.

Skaife, otherwise known as ravenmaster Chris, is a specially trained Yeoman Warder or "Beefeater." Just six people have held the position, earning the chance to wear a special ravenmaster badge on the arm of their famous uniform.

"First thing in the morning, I'll come down here [and] make sure the ravens are OK," Skaife says. "Make sure they're healthy, feed them, clean them, just general maintenance of looking after them — as you would with any normal pet."

But the ravens — Erin, Rocky, Gripp, Muninn, Jubilee and Merlin — are far from being normal. In addition to the importance of their responsibility and their superstar status, they draw a crowd of four million people a year.

Ravenmaster Chris Skaife

The ravenmaster badge is a special decoration to the traditional Beefeater uniform, and worn only by six throughout history. (Jacqueline/CBC News)

Bringing ancient tradition to a modern stage

The impact that the ravens have on tourism doesn't go unnoticed. It's part of the reason why the tower, operated by Historic Royal Palaces, recently renovated the birds' quarters, moving them from their modest homes to a brand new, bespoke habitat.

The open-concept pad took two years to complete and opened at the end of last year. It was designed by London architectural firm Llowarch Llowarch, in consultation with the ravenmaster and aviary specialists at the London Zoo.

The modern accommodations allow the ravens to spend all day and night in a habitat much like what they might encounter in the wild.

Tower of London - raven habitat

Tourists pose for selfies in front of the new raven habitat, which opened in late 2015. (Provided/Llowarch Llowarch)

Tower of London - Raven habitat

When new meets old: the brand new, bespoke raven habitat stands out among the centuries­-old buildings that surround it on the grounds of the Tower of London. (Provided/Llowarch Llowarch)

Though the ravens can freely explore the tower's grounds during the day, they return to the enclosure at night. One wing of each bird is trimmed to prevent the ravens from straying too far. The tower had another close call in 2013, when a fox killed two of the prized birds just before they were due to be locked up for the night.

Nicola Llowarch, the architect who headed the project, says that a focus on tourism and educational outreach was at the forefront of the design process.

"The main aspect was to expand the visitor experience," says Llowarch, noting research shows the ravens are one of the Top 3 attractions at the tower, along with the Crown jewels and the Beefeaters.

"So that was a prerequisite: to provide this accommodation and to address the public," she adds. "With the previous [accommodation], there was no attempt at working with the ravens as a public attraction."

Ravenmaster Skaife is also eager to introduce the historic attraction to a modern audience. His popular Twitter page — where he shares photos, videos and facts about the ravens, their daily routine and their history — has more than 12,000 followers.

He also created an app that visitors can use on the grounds to access information about the ravens and the tower's legends through short animated videos.

"It's a simple app. It tells you about some of the stories with the ravens — one of them during the Second World War, one about Charles II, and one of them going back even further to Bendigeidfran."

Bendigeidfran is a king from Welsh mythology who had his head buried on the tower's grounds following his death so he could always keep a lookout for intruders. It's said that Brân (the Welsh word for raven) lives on through the tower's birds.  

While the increased focus on educational outreach around the ravens is all part of Historic Royal Palace's plan to enhance the tower as a tourist attraction, Skaife says it's also important to him.

"I'm hoping in the future to be able to do even more," he says. "Teachers can come here and I can talk to the children about the ravens, and they can get on their iPads and see where they are in the wild. So I can connect the legend of the ravens here with the environment that ravens live in in nature."

Raven app at Tower of London

Using an interactive iPhone app, visitors to the Tower of London can read and watch videos about some of the myths and legends of ravens. (Jacqueline/For CBC News)