An 88-year-old man who suffers from dementia has been charged with shooting a woman in the legs, leading to a five-hour standoff with police at his Far South Side home Tuesday afternoon, according to Chicago police.

Gene Sanderlin shot the 22-year-old woman at about 3:45 p.m. Tuesday and then barricaded himself inside his home in the 10400 block of South King Drive in the Rosemoor neighborhood, police said.

The situation was resolved peacefully by 8:45 p.m. when Sanderlin was taken into custody by SWAT officers, police said.

The woman was shot after an argument, police said. She ran to a neighbor’s home and called police. She was taken to Advocate Christ Medical Center, where her condition was stabilized, police said.

Responding officers saw Sanderlin standing in the window of his home but he would not come outside, police said.

Sanderlin has a valid firearm owners identification card, police said. He was scheduled to appear in Central Bond Court on Thursday.