Mother-of-two Mrs Gibbons was released four days after being convicted for insulting religion.

Following her release, Mr Miliband said the teacher was "a little overwhelmed" at the attention her case had attracted, but was in "remarkably good spirits" and "elated to be back on her way home".

He added: "She has shown very good British grit in very difficult circumstances, but I know that the most important thing for her is to get home as soon as possible and return to her family."

He also hailed the "team effort" which led to Mrs Gibbons's release, praising diplomatic staff and saying that the intervention of two British Muslim peers - Baroness Warsi and Lord Ahmed - had been "an important contribution".

Khartoum protest

Earlier, a demonstration of about 30 or 40 people was held outside the embassy in Khartoum, with banners protesting about the decision to release her.

Mrs Gibbons was arrested on 25 November and jailed on 29 November after allowing her pupils to name a teddy bear Muhammad.

"Everyone's been really great. Obviously it's a great feeling today, we're very pleased, we have been under a lot of pressure."

Ibrahim Mogra from the Muslim Council of Britain told BBC News 24 that the whole saga had been very damaging for the image of the Muslim faith as it could lead some people to "feel that Islam has no place in modern society".

President al-Bashir had been under pressure from Sudanese hardliners to ensure Mrs Gibbons served her full sentence, while others called for a retrial and for the sentence to be increased.

Jonah Fisher, the BBC's former BBC Khartoum correspondent, said: "The carefully stage-managed pardoning of Mrs Gibbons by Sudan's President Omar al-Bashir will have satisfied few within his divided government."