Alex Bursch, 28, of Antioch, was sentenced by U.S. District Judge Phyllis Hamilton on Wednesday and was also ordered to pay a $2,000 fine.
Bursch formerly taught at Los Medanos Elementary School and was also a swim coach for the Pleasant Hill Dolfins, a youth swim team.
He was convicted on Aug. 29 by Hamilton in a one-day nonjury trial of one count of possessing child pornography on Sept. 1, 2010.
That date was the day that Contra Costa County sheriff's detectives arrested Bursch after discovering pornography images on his computers in a search of his home.
Prosecutors said in a sentencing brief that authorities found approximately 4,000 child pornography images and 150 child pornography videos on the computers.
They said the investigation began when an undercover officer discovered that a computer using Bursch's Internet connection was sharing child pornography images through the use of peer-to-peer file-sharing software.
Prosecutors had asked for a sentence of seven years and three months in prison, while Bursch's defense attorneys asked for probation, saying that Bursch had no previous criminal record and was amenable to treatment.
U.S. Attorney Melinda Haag said that in imposing the four-year, nine-month sentence, Hamilton noted that Bursch's collection contained a large number of images and that some of the images were of prepubescent children and of sadistic sex acts involving children.
Hamilton denied Bursch's request to be allowed to remain free during an appeal and ordered him to surrender to begin serving his sentence on Jan. 28.