The incident took place in the Pasarlapudi village under Amalapuram mandal of East Godavari district on Thursday evening.
"The baby is now recovering and her health condition is satisfactory," said Prabhakar Deepak Chakravarthy, the doctor who led the medical team that performed the surgery at a private hospital in Amalapuram.
The girl swallowed the mobile earphone while playing with it at her home. Her constant cries attracted the attention of her parents who could not fathom the reason for her condition.
However, an X-ray revealed an article stuck in her body which was later identified as a mobile earphone, he said.
A team of doctors performed the surgery and safely removed the earphone, Dr Chakravarthy added.