The charged was dismissed after the judge found the 17-year-old was defending himself against a sexual advance, according to court records.

PANAMA CITY — A teenager held in adult jail for months after stabbing a man has had his charge of attempted murder dismissed after a local judge found he was defending himself against a sexual advance, according to court records.

Logan Mitchell Chandler, 17, appeared in court Thursday facing charges of burglary, attempted second-degree murder and resisting arrest without violence in connection with the incident. The Panama City Police Department arrested him after an April 12, 2017, burglary of a vacant home on Louisiana Avenue ended with 21-year-old Marquan Riley suffering four stab wounds. By the end of Tuesday’s hearing, though, Circuit Judge Michael Overstreet dismissed the charges Chandler faced for stabbing Riley, court records stated.

A couple of months earlier, Chandler’s defense attorney, Waylon Graham, had filed a motion to dismiss the charges as part of a "stand your ground" defense because Chandler had been defending himself against a sexual advance. He and Riley had broken into the vacant Louisiana Avenue house that evening to smoke what police descibed as a "blunt laced with drug molly." Riley, however, began to force himself upon Chandler, according to the motion.

“In an attempt to determine if there was a way out, (Chandler) began walking around the room,” the motion states. “Riley stepped between (Chandler) and the door, grabbing (Chandler’s) hand and telling (him) that he was going to do whatever Riley said or he was going to kill him.”

Chandler attempted get Riley to release his hands, but he wouldn’t let go, the motion states. As Riley continued his advance, Chandler was able to get one hand free, grab his knife and stab Riley multiple times in order to get away.

“Chandler removed a knife and stabbed Riley four times; two times to the neck, one to the abdomen, and there was a defensive wound to the outside of Riley’s left arm,” PCPD reported. “During a sworn statement with Chandler, he admitted that his intent was to kill Riley.”

Riley’s injuries were non-life-threatening, police reported.

Chandler then fled the vacant house and ran up to people walking in the street, screaming “help, help” and “call 911,” but they did nothing, the motion stated. He then unsuccessfully tried to find help at other nearby business before running home. After telling his mother what happened, she called the police to the scene, the motion states.

Chandler provided a filmed walk-through of the scene and an explanation of what events transpired. He was nonetheless arrested and taken to the Department of Juvenile Justice (DJJ) for processing. His case was waived up to adult court April 28, 2017, and he was held on a $51,000 bond until Sept. 20, court records stated.

Chandler was recommitted in October and then held in the jail until being conditionally released in February as the case proceeded in court. His defense attorney filed the motion to dismiss the charges about a month later.

Overstreet agreed with Chandler’s attorney and dismissed the charges Thursday with prejudice.