Tex. Penal Code § 39.04 — TX Code / Code pe / Chapter 39 / Section 39.04
§ 39.04. VIOLATIONS OF THE CIVIL RIGHTS OF PERSON IN CUSTODY; IMPROPER SEXUAL ACTIVITY WITH PERSON IN CUSTODY OR UNDER SUPERVISION.
Status: in_force

(a) An official of a correctional facility or juvenile facility, an employee of a correctional facility or juvenile facility, a person other than an employee who works for compensation at a correctional facility or juvenile facility, a volunteer at a correctional facility or juvenile facility, or a peace officer commits an offense if the person intentionally:

(1) denies or impedes a person in custody in the exercise or enjoyment of any right, privilege, or immunity knowing his conduct is unlawful; or

(2) engages in sexual contact, sexual intercourse, or deviate sexual intercourse with an individual in custody or, in the case of an individual in the custody of the Texas Juvenile Justice Department or placed in a juvenile facility, employs, authorizes, or induces the individual to engage in sexual conduct or a sexual performance.

(b) An offense under Subsection (a)(1) is a felony of the third degree. An offense under Subsection (a)(2) is a felony of the second degree, except that an offense under Subsection (a)(2) is a felony of the first degree if the offense is committed against:

(1) an individual in the custody of the Texas Juvenile Justice Department or placed in a juvenile facility; or

(2) a juvenile offender detained in or committed to a correctional facility.

(b) An offense under Subsection (a)(1) is a Class A misdemeanor. An offense under Subsection (a)(2) is a felony of the second degree.

(c) This section shall not preclude prosecution for any other offense set out in this code.

(d) The Attorney General of Texas shall have concurrent jurisdiction with law enforcement agencies to investigate violations of this statute involving serious bodily injury or death.

(e) In this section:

(1) "Correctional facility" means:

(A) any place described by Section 1.07(a)(14);

(B) any place or facility designated for the detention of a person suspected of violating a provision of the Immigration and Nationality Act (8 U.S.C. Section 1101 et seq.); or

(C) a "secure correctional facility" or "secure detention facility" as defined by Section 51.02, Family Code.

(1) "Correctional facility" means any place described by Section 1.07(a)(14).

(2) "Custody" means the detention, arrest, or confinement of an adult offender, the detention of a juvenile offender, or the commitment of a juvenile offender to a correctional facility or juvenile facility.

(2-a) "Juvenile facility" means:

(A) a facility operated by the Texas Juvenile Justice Department or a private vendor under a contract with the Texas Juvenile Justice Department; or

(B) a facility for the detention or placement of juveniles under juvenile court jurisdiction and that is operated wholly or partly by a juvenile board or another governmental unit or by a private vendor under a contract with the juvenile board or governmental unit.

(3) "Sexual contact," "sexual intercourse," and "deviate sexual intercourse" have the meanings assigned by Section 21.01.

(4) "Sexual conduct" and "performance" have the meanings assigned by Section 43.25.

(5) "Sexual performance" means any performance or part thereof that includes sexual conduct by an individual.

(f) An employee of the Texas Department of Criminal Justice, the Texas Juvenile Justice Department, a juvenile facility, a local juvenile probation department, or a community supervision and corrections department established under Chapter 76, Government Code, a person other than an employee who works for compensation at a juvenile facility or local juvenile probation department, or a volunteer at a juvenile facility or local juvenile probation department commits an offense if the actor engages in sexual contact, sexual intercourse, or deviate sexual intercourse with an individual who the actor knows is under the supervision of the Texas Department of Criminal Justice, Texas Juvenile Justice Department, probation department, or community supervision and corrections department but not in the custody of the Texas Department of Criminal Justice, Texas Juvenile Justice Department, probation department, or community supervision and corrections department.

(g) An offense under Subsection (f) is a state jail felony.

(h) It is an affirmative defense to prosecution under Subsection (f) that the actor was the spouse of the individual at the time of the offense.