It further strained relations already frayed over the conflict in Darfur.
Ahmed and Warsi, both members of the country's upper house of parliament, thanked Sudan and conveyed apologies from Gibbons for any offence she may have unwittingly caused.
Reading out a statement on the teacher's behalf, Warsi said Gibbons was deeply sorry for any offence caused and that she had great respect for Islam.
"I have great respect for the Islamic religion and would not knowingly offend anyone and I'm sorry if I caused any distress," Gibbons was quoted as saying.
She said she would "miss terribly" the friends she had made in Sudan.
Gordon Brown, the British prime minister, welcomed the pardon, saying he was "delighted and relieved".
"Common sense has prevailed," he said soon after news of Gibbons' imminent release was announced.
He said she was to be handed over to the British embassy in Khartoum "after what must have been a difficult ordeal".
Ahmed and Warsi had launched a private initiative to secure Gibbons' early release.
The two delayed their departure after al-Bashir confirmed a last-minute meeting following a two-day wait.
Gibbons let her pupils at Khartoum's private Unity High School pick their favourite name for a teddy bear as part of a project on animals in September.
Twenty out of 23 of them reportedly chose Muhammad - a popular boy's name in Sudan, as well as the name of Islam's holy prophet.
Sudan's influential had Council of Muslim Scholars urged the government not to pardon Gibbons, saying it would damage Khartoum's reputation with Muslims around the world.
Hundreds took to the streets of the capital on Friday, many waving swords and Islamic flags, calling for her death.