The 20-year-old singer was pictured in the Sun newspaper walking on crutches after returning to the UK.
"Hey guys I know most of you have seen those pics today! Yes I've had major knee surgery, a much larger surgery than first anticipated," he tweeted.
"But i would like to tell u , it was a complete success! Considering the scale of it."
One Direction are due to tour later this year, with their UK dates starting in May.
"All I ask of you guys is that you would respect my privacy as I try to recover... for the Where We Are tour," he wrote on Twitter.
Earlier this week bandmate Liam Payne apologised for a picture taken of him balancing on a ledge.
The photo had been posted on Twitter but has since been taken down.
The singer tweeted: "You may have seen a photo of me today taken on top of a building. I regret being there and having a photo taken.
"It was a stupid and irresponsible thing to do. I am sorry, and do not endorse any fans trying to repeat this, as it is extremely dangerous."
It has also been announced that the band will release two books in 2014.
The group have signed a deal with HarperCollins to publish an official autobiography and One Direction: The Official Annual 2015.
Follow @BBCNewsbeat on Twitter
One Direction singer Niall Horan has confirmed that he has had an operation on his knee in the US.