Ahmed Shah, the uncle of Malala Yousufzai, told reporters in Peshawar that the surgery was conducted late last night at a military hospital and that the bullet had been successfully removed.
He said that the doctors have advised against taking Malala, the first recipient of Pakistan's National Peace Award for Youth, outside Pakistan for treatment.
Doctors said it will not be advisable for her to travel in her condition.
Doctors treating Malala, who was shot at by the Taliban in Pakistan. Photo: AFP
The next ten days would be crucial for her, the doctors stressed.
The officials of the Khyber Pakhtunkhwa government also said the bullet had been removed after a three hour operation.
Malala was hit by two bullets yesterday when Taliban militants fired at her inside a school bus at Mingora, the main town of the Swat Valley located 160 km from Islamabad.
One bullet hit her in the head and it travelled downwards and was lodged close to her backbone.
Tehrik-e-Taliban Pakistan spokesman Ihsanullah Ihsan claimed responsibility for the attack in phone calls to journalists in the country's northwest.
He said Malala was targeted because of her "pro-West" views and for "negative propaganda" against the Taliban.
Ihsan said the girl would "not be spared" for her opposition to the Taliban and would be targeted again if she survived.
Malala had emerged as an unlikely champion of peace in the former Taliban stronghold of Swat after she wrote about the atrocities of the militants in a blog for BBC Urdu under the pseudonym of Gul Makai.