A British teacher jailed for insulting Islam after she allowed her students to name a teddy bear Muhammad flew home Monday after Sudan's president pardoned her, a British embassy spokesman said.

Gillian Gibbons' conviction under Sudan's Islamic Sharia law shocked Britons and many Muslims worldwide. Hard-line Muslim clerics in Sudan accused her of intentionally seeking to insult Islam's Prophet Muhammad, and the case angered some Sudanese, sparking a protest where demonstrators called for her execution.

Her release came after two British Muslim politicians from the House of Lords met with Sudanese President Omar al-Bashir early Monday to plead for her freedom.

Gibbons also sent a written statement to al-Bashir that she did not intend to offend anyone and had great respect for Islam.

Hours after al-Bashir's pardon, Gibbons left the country on a flight home. "I can confirm she has left Sudan," spokesman Omar Daair told The Associated Press. She was believed to be on an Emirates flight with a stopover in Dubai before heading to London early Tuesday.

Gibbons, 54, was sentenced Thursday to 15 days in prison and deportation for insulting Islam because she allowed her students to name a teddy bear Muhammad — a common name among Muslim men — in a class project on animals. The trial was sparked when a school secretary complained to the Education Ministry that Gibbons aimed to insult the Prophet Muhammad. Her time in jail since her arrest Nov. 25 counted toward the sentence.

Lord Nazir Ahmed, who met with al-Bashir earlier Monday along with Baroness Sayeeda Warsi, said the case was an "unfortunate misunderstanding" and stressed that Britain respected Islam.

He hoped "the relations between our two countries will not be damaged by this incident," Ahmed told reporters at the presidential palace after Monday's meeting.

Ghazi Saladdin, a senior presidential adviser, said al-Bashir insisted that Gibbons had a "fair trial," but he agreed to pardon her because of the efforts by the British Muslim delegation.

"We are very relieved and happy that she has been pardoned," said Robert Boulos, director of Khartoum's Unity High School, where Gibbons worked.

In the written statement released by Sudanese presidential palace and read by Warsi to reporters, 54-year-old Gibbons said she was sorry if she caused any "distress."

"I have a great respect for the Islamic religion and would not knowingly offend anyone," Gibbons, who was sentenced Thursday, said in the statement.

"I am looking forward to seeing my family and friends, but I am very sorry that I will be unable to return to Sudan," the statement read.

The teacher escaped harsher punishment that could have included up to 40 lashes, six months in prison and a fine. Her time in jail since her arrest last Sunday counted toward the sentence.

During her trial, the weeping teacher said she had intended no harm. Her students, overwhelmingly Muslim, chose the name for the bear. Muslim scholars generally agree that intent is a key factor in determining if someone has violated Islamic rules against insulting the prophet.

The conviction shocked many Britons, but the case was caught up in the ideology that al-Bashir's Islamic regime has long instilled in Sudan, a mix of anti-colonialism, religious fundamentalism and a sense that the West is besieging Islam.

In Britain, Prime Minister Gordon Brown said he was delighted by news.

"Common sense has prevailed," Brown said in a statement released by his office.

The case also sparked criticism from many Muslims in the West who said she should have never been arrested. On Monday, Inayat Bunglawala, a spokesman for the Muslim Council of Britain, welcomed the pardon.

"It will be wonderful to see her back in the U.K. I am sure she will be welcomed by both Muslims and non-Muslims after her quite terrible ordeal at the hands of the Sudanese authorities," Bunglawala said.

A small group of about 40 protesters gathered briefly Monday in front of the British embassy in Khartoum and handed over a petition, spokesman Daair said, without describing the petition. But several cars of riot police arrived and dispersed the crowd.

On Friday during a rally in Khartoum, thousands of protesters, many armed with clubs and swords and beating drums, burned pictures of her and demanded her execution.

After the rally, there were fears for Gibbons' safety and she was moved from the Omdurman women's prison to a secret location, her lawyer has said.

There was no overt sign that the government organized the protest, but such a rally could not have taken place without at least official assent.

Sudan's ambassador in London, Khalid al-Mubarak, insisted Monday that the demonstrations "were an argument from the fringe."