(WANE) — An Oklahoma man registered as a sex offender received 40 years in prison Thursday for transporting child pornography of an 18-month-old, according to the U.S. Justice Department (DOJ).

According to court documents, 41-year-old Matthew McNair was in Indiana in 2017 when he used an electronic device to take sexually explicit photographs of an 18-month-old infant.

After taking the photographs, McNair took the images on his device back to Oklahoma, where he was living at the time, and uploaded them to his cloud account, according to the DOJ.

The DOJ said McNair was required to register as a sex offender at the time of the offense based upon his 1999 conviction in Illinois for attempted criminal sexual assault.

McNair was sentenced for transporting child pornography and being a person required to register as a sex offender who committed a felony offense involving a minor.