Image caption The 27 theme refers to the number of years Nelson Mandela spent in prison

Eddie Izzard will attempt to run 27 marathons in 27 days through South Africa for Sport Relief, the BBC has announced.

It means the comic will, in total, try to run more than 700 miles in temperatures of up to 30 C.

The significance of the number 27 comes from the number of years Nelson Mandela spent in prison.

The anti-apartheid campaigner was President of South Africa from 1994 to 1999 before his death in 2013 aged 95.

Izzard said he was "delighted" to be taking on the challenge but added: "Of course, 27 marathons in 27 days is nothing compared to what Nelson Mandela did by serving 27 years in prison.

"He was a great soul and leaves a fantastic legacy for the world."

During his marathons, Izzard will explore the histories of South Africa and Nelson Mandela, as well as visiting communities, organisations and families that have all been helped by the work of Comic Relief and Sport Relief.

His journey is due to finish on 20 March when he arrives an the Union Buildings in Pretoria where Nelson Mandela gave his inaugural speech as the first democratically elected President of South Africa.

Izzard, 54, previously attempted a similar feat in South Africa in 2012, but had to pull out for health reasons.

He also completed 43 marathons in 51 days across the UK for Sport Relief in 2009, raising over £1.8m in the process.

Speaking about his past attempts, Izzard said: "I tried to do this four years ago and failed. This time I will succeed.

"But if I fail, I will come back again and again and again until I do succeed. Because that's what Nelson Mandela would have done."

The marathons will be covered on BBC Three, which is about to move from television to online.

Sport Relief raises money for disadvantaged people in some of the world's poorest communities.

It takes place every two years, alternating with Red Nose Day.