A Westlake man was sentenced Thursday to 24 years and four months in federal prison for kidnapping a 15-year-old girl from Oregon, raping her, and filming it, federal officials said.

Travis Smith, 28, pleaded guilty on Jan. 20 to one count of production of child pornography, though during his Thursday sentencing, Judge John A. Kronstadt said Smith’s “inexcusable” conduct had a “profound effect” on the girl, who was deceived by Smith after they met online, the Department of Justice said in a news release.

Smith, at the time a 26-year-old father of two who was living with his estranged wife, pretended to be a 16-year-old boy, but then he turned the relationship in a “sexual and abusive” direction, authorities said.

“Smith demand[ed] the victim perform painful sex acts on herself as punishment for behavior such as speaking with boys or not answering him quickly enough,” the release explained.

When the girl tried to end the relationship, Smith threatened to send sexually explicit images to her family and friends. Then he drove to her home in Oregon and kidnapped her by threatening to shoot the girl and her family, the prosecutors said.

“He attempted to hide the victim’s whereabouts by having her destroy her cellphone. On the drive and thereafter, Smith repeatedly raped the victim. Once in Los Angeles, he hid the victim in his Westlake apartment for several days. While there, he filmed himself raping her,” the release said.

After “days of captivity,” the girl was rescued by the FBI.