UK House of Lords peers Lord Nazir Ahmed and Baroness Sayeeda Warsi secured Gibbons' early release after meeting Omar al-Bashir, the Sudanese president on Monday.
Police heavily secured Khartoum airport as Gibbons flew out.
The arrest and jail sentence of the 54-year-old sparked outrage in Britain and a diplomatic crisis between London and Khartoum.
It further strained relations already frayed over the conflict in Darfur.
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 Muhammed - a popular boy's name in Sudan, as well as the name of Islam's holy prophet.
Sudan's influential Council of Muslim Scholars urged the government not to pardon Gibbons, saying it would damage Khartoum's reputation with Muslims around the world.
Hundreds of people took to the streets of the Sudanese capital on Friday, many waving swords and Islamic flags and calling for her execution.