A British teacher has been found guilty in Sudan of insulting religion after she allowed her primary school class to name a teddy bear Muhammad.
Gillian Gibbons, 54, from Liverpool, has been sentenced to 15 days in prison and will then be deported.
She escaped conviction for inciting hatred and showing contempt for religious beliefs, and will now appeal.
Foreign Secretary David Miliband has expressed "in the strongest terms" the UK's concern at her detention.
The Sudanese ambassador, Omer Siddiq, was called back to the Foreign Office to explain the decision.
Officials said that during his 45-minute meeting Mr Miliband also spoke to the Sudanese acting foreign minister for 15 minutes on the telephone.
"There will be further contacts overnight and tomorrow in the search for a swift resolution of this issue," the Foreign Office added.
Before the meeting, Mr Miliband said he was "extremely disappointed" the charges had not been dismissed and repeated his view that it had been an "innocent misunderstanding by a dedicated teacher".
"Our priority now is to ensure Mrs Gibbons' welfare, and we will continue to provide consular assistance to her," he said.
"I have called in the Sudanese ambassador this evening to explain the decision and to discuss next steps."
Meanwhile, Archbishop of Canterbury Rowan Williams said he could not "see any justification" for the sentence, calling it an "absurdly disproportionate response" to a "minor cultural faux pas".
Officials at the Foreign Office say the mood has changed as a result of the verdict.
The prime minister, Sudanese embassy officials in London and UK Muslim organisations all expressed the hope that Mrs Gibbons would be released.
But Sudan's top clerics had called for the full measure of the law to be used against Mrs Gibbons and labelled her actions part of a Western plot against Islam.
She could have faced up to 40 lashes if found guilty on all three charges against her.
In September, Mrs Gibbons allowed her class of primary school pupils to name the teddy bear Muhammad as part of a study of animals and their habitats.
The court heard that she was arrested on Sunday after another member of staff at Unity High School complained to the Ministry of Education.
The BBC's Adam Mynott, in Khartoum, said Mrs Gibbons apologised to the court for any offence she may have caused.
The school's director, Robert Boulos, told the AP news agency: "It's a very fair verdict, she could have had six months and lashes and a fine, and she only got 15 days and deportation."
He said Mrs Gibbons would only serve another 10 days in prison, having already spent five in custody since her arrest.
Prosecutor general Salah Eddin Abu Zaid had said Mrs Gibbons could expect a "swift and fair trial".
But Catherine Wolthuizen, chief executive of Fair Trials International, said Mrs Gibbons' treatment was excessive.
She said: "It was a very speedy justice process. Although she has been found guilty of all the counts of causing offence, she has thankfully not been subjected to 40 lashes.
"Having said this, 15 days in a Sudanese prison for an innocent misunderstanding is a serious and harsh punishment indeed."