AUSTIN, Texas (AP) — A Texas swimmer who helped the Longhorns take second place in the NCAA championships last weekend was granted deferred adjudication on a criminal trespass charge for a 2017 incident in which he allegedly entered a woman's Austin home and was subdued by police with a stun gun.

Ryan Harty was charged with a Class A misdemeanor. A Travis County judge on Wednesday ordered him to perform 50 hours of community service, submit to random drug testing and pay a $200 fine. If he stays out of trouble for 14 months, the charge will be dismissed.

According to police, Harty was shirtless when he walked into the woman's house and she ran out the back door to a neighbor's home. Police confronted Harty and said they had to use a Taser to subdue him when he tried to run. A friend who had been looking for Harty told police he was under the influence of a hallucinogenic substance.

Texas did not immediately comment. Harty attorney Bruce Fox called it a one-time incident and said Harty has no other criminal record.

Harty, a junior, swam several individual and relay events for Texas at the NCAA championships. He finished fifth in the 100-meter backstroke.