He also uploaded the explicit images and videos of the girl to pornography websites and bombarded the school's Facebook page with links to the sites, in an attempt to shame her.
"He is trying to punish the child or the family. It's a jilted relationship. He wants revenge," the school principal told the Weekend Herald yesterday.
This newspaper has chosen not to name the school, in order to prevent further trauma for the girl.
"The pressure on the girl is immense," the principal said. "But we are very proud of how the community has wrapped around her to support her. We just want the whole of New Zealand to realise that this is serious and scary and we need to do something about it."
The girl had been undergoing counselling and the school held assemblies for students this week to warn them about the dangers of sharing images online.
The principal also sent letters home to parents to explain the situation. The school's website was still down last night.
He said the school had had huge support from the cyber safety experts and police as they worked to find the man behind the cyber crime, and to restore the school's servers. Interpol was involved.
Netsafe executive director Martin Cocker said that while cases of teenagers sharing images unwisely was not uncommon, the lengths the perpetrator was going to were very aggressive.
"It is a sustained attack. The vindictiveness is very unusual," he said. "He's a very determined character. The majority wouldn't continue to harass and attack any party they can find in the way that he has."
The girl's relationship with the man began through online gaming. It progressed to sharing explicit images, and then Skype calls where the girl undressed in front of a camera.
Mr Cocker said he was extremely concerned about the victim, but she did not need to be ashamed.
"I'm always concerned they are going to feel like they are the first person who has ever been in this situation and feel isolated. That's not the case."
Cases of sexual exploitation were a growing challenge, he said.
Principal Patrick Walsh, the head of the online safety advisory group, said he was hoping new harmful-communications laws to be enacted soon would help schools to deal with such issues. "We've tried an educational approach and it works to a point. The new [laws] will give some teeth to schools to prosecute, which sends a strong message."
He said it wouldn't however help with this case, which involved an overseas offender.
A police spokesman said the National Cyber Crime Centre was investigating unauthorised access and postings on the website and social media pages of the school. The investigation was in its early stages. There were a number of technical matters relating to the inquiry.
Hacking or launching a denial-of-service attack carries a punishment of up to seven years' imprisonment.
Keeping kids safe online - tips from the experts
• Talk to your children. Parents should realise there needs to be no secrets with teenagers. It's dangerous.
- School Principal
• Make sure teenagers understand the importance of keeping details private. Not using their full names or revealing addresses or phone numbers are ways to keep safe.
- Kidspot
• If your child tells you about an issue reassure them they've done the right thing to trust you with the problem.
- Netsafe
• Negotiate clear guidelines for web and online game use that fits your kids' maturity and family's values. Pay attention to what kids do and who they meet online.
- Microsoft