JAKARTA, Indonesia  A recently erected statue of President Obama as a 10-year-old boy will be removed from a public park here, city officials said Friday, bowing to vociferous criticism on Facebook just a month before Mr. Obama is scheduled to visit Indonesia.

The statue will be relocated as soon as possible to an elementary school that Mr. Obama attended during the four years he spent here, the governor of Jakarta, Fauzi Bowo, told reporters.

In December, the city unveiled the 43-inch-tall bronze statue in a park in Menteng, the neighborhood where Mr. Obama lived with his divorced mother and Indonesian stepfather in the late 1960s. Financed by $10,000 from Mr. Obama’s supporters here, it depicts the boy known at the time as Barry in shorts and a T-shirt, smiling as a butterfly lands on his left thumb.

But the statue of Mr. Obama  who successfully exploited the potential of social networking sites during the 2008 presidential campaign  soon became the target of intense ire of critics who said that Mr. Obama had done nothing for Indonesia and that the park should be reserved to honor an Indonesian.