The judge also ruled that Vance Fulkerson must register as a sex offender when he gets out of prison. He was taken out of the courtroom in handcuffs.
Fulkerson pleaded guilty to a charge of exploitation of children as part of a plea deal in early January.
Before the judge decided on a sentence, Fulkerson spoke before the court.
"I am ashamed of my secretive fantasizing and I pray that its disclosure does not invalidate my previous attempts to foster their belief in themselves and their talent and I apologize to them sincerely from the bottom of my heart," he said.
"First and foremost, there was nothing they did that was a direct cause or in any way justified my behavior, my misuse of their presence in my life was purely the consequence of my own distorted thinking and immersion in fantasy, nothing they did caused this," he said. "I also want to apologize to the university and family and friends I've met ... I apologize to them all."
Fulkerson's attorney had argued for probation.
Fulkerson taught theater at UNC for 20 years before he was arrested in July. He resigned last fall.
Investigators say he used a hidden camera above the toilet to videotape male students who came over to his house for singing lessons. Police say they also found child pornography in his home.
An independent investigation cleared UNC of any wrongdoing connected with Fulkerson's arrest.
The investigators were asked to look into accusations that the university failed on several occasions to address student complaints about Fulkerson and his alleged inappropriate behavior.
Some of those complaints date back to the early '90s.
(KUSA-TV © 2010 Multimedia Holdings Corporation)