To neighbors, it looked like a “moonshine shack,” a little yellow wooden hut, with overgrown weeds and no indoor plumbing, banged together by its owner, Robert Lewis Dear Jr.

And whenever Dear came to stay in his shack in the woods, the neighbors in Anderson Acres, a community of about seven houses along a steep, gravel road here, kept their kids inside.

“He was the kind of person you had to watch out for,” one neighbor said. “He was a very weird individual. It’s hard to explain, but he had a weird look in his eye most of the time.”

Dear, 57, the man in custody in connection with Friday’s shooting at a Planned Parenthood clinic in Colorado Springs, appears to have been a malcontent who drifted from place to place. In the past couple of years, in addition to the shack, he also lived in a mobile home in another town in North Carolina and a camper in Colorado, which he shared with a woman who moved with him from the East Coast.

Some who knew him found him to be unremarkable, while others said that he seemed to be delusional and aggressive. He had a history of run-ins with neighbors and police, including arrests for alleged cruelty to animals and allegedly being a “peeping Tom.” He was not convicted in either case.

“It’s just too devastating; it’s just something you can’t fathom happening,” Pamela Ross, who was married to Dear nearly 20 years ago, said in a brief interview Saturday. She declined to comment further.

Dear’s problems with the law date to 1997, when his then-wife reported to police that Dear had assaulted her, according to reports filed with the sheriff’s office in Colleton County, S.C., where Dear lived at the time. She declined to file charges against him but told police she reported the incident because she “wanted something on record.”

Colleton County police released reports of at least seven other episodes in which Dear, who described himself to police as a self-employed art dealer, had disputes or physical altercations with neighbors or other residents.

As of Saturday evening, it was unclear whether Dear had obtained a lawyer.

In May 2002, a woman who lived next door to Dear in Walterboro, in Colleton County, complained to police that Dear had been “making unwanted advancements” toward her since she and her husband had moved in a year earlier.

The woman told police that she had seen Dear hiding in the bushes next to their house at 5:30 a.m. She “heard her guard dog barking and saw Mr. Dear looking into her house.”

In Anderson Acres, neighbors said they recognized Dear from television news coverage of Friday’s shootings, in which police said he killed three people, including a police officer, and wounded nine others. They said he looked more beaten down than the last time they had seen him, and that his beard was new — but that he was the same aloof, angry man they remembered.

“He complained about everything,” said another neighbor who, like others, spoke on the condition of anonymity, saying that he feared for his security. “He said he worked with the government, and everybody was out to get him, and he knew the secrets of the U.S.A. He said, ‘Nobody touch me, because I’ve got enough information to put the whole U.S. of A in danger.’ It was very crazy.”

Dear lived in a mobile home in Swannanoa, N.C., until about a year ago. On Saturday, the trailer appeared vacant, dilapidated and filthy. A Volkswagen Beetle was left rusting in front yard, along with an RV covered in mold. A small wooden shed sat rotting, filled with large cans of beans, corn and other food. A decaying mattress and sofa sat in the back yard.

A handwritten sign said the property is for sale for $53,000.

Dear was extremely reclusive, according to his next-door neighbor Robert Adams, 64. Adams recalls having just two conversations with Dear over the five years that Dear lived there.

“He was a good neighbor in that he stayed almost completely to himself,” Adams said.

FBI agents from the bureau’s Charlotte office arrived at the shack Saturday afternoon and began interviewing neighbors.

In Colorado, police also surrounded Dear’s camper in the tiny mountain town of Hartsel and shut down the road leading to it. At the Highline Cafe and Saloon, where a buck and raccoon were mounted on the walls, the owners said that Dear came in a couple of times a month and ate lunch and ordered tea. “He didn’t seem crazy, though. Just like someone who wanted to be left alone,” said Jamie Heffelman, who owns the saloon with her husband.

Dear moved to Colorado last year, when he bought a five-acre plot of land in Hartsel, about 40 miles west of Colorado Springs, according to Jim Anderson, the real estate agent who brokered the deal. The previous owner said that Dear paid $6,000 for the vacant land.

“He said he wanted a cheap piece of land to put a camper on,” Anderson said.

The real estate agent said Dear arrived with a small pickup truck and paid $4,000 for a “pull-behind” camper that Anderson’s friend was selling. Anderson said Dear set up the camper on the flat land, which has no trees, and lived there.

Dear also asked Anderson whether he could have his mail delivered to Anderson’s address. He came by a couple of times in the past year to pick up letters, which were mainly from the local county government.

Dear did nothing that seemed unusual to Anderson, and while he said he did not see Dear with a gun, many people in the area own weapons.

“Out here, everybody has a gun,” Anderson said. “There are bears and mountain lions.”

Anderson said he was shaken by the news that Dear was the alleged Colorado Springs shooter. He said Dear’s mug shot on TV looked far more wild-eyed than the average man he met.

“Man. Wow. A shocker,” Anderson said. “He seemed okay to me. Just like anybody who wanted to buy a piece of land in this one-horse town.”

Colorado records show that Dear was registered to vote in Hartsel since at least October 2014. His party was listed as “unaffiliated.”

Anderson also said that Dear arrived with a woman, but he did not know her name. Colorado records show that Stephanie Michelle Bragg was registered to vote at the same address earlier this year.

Her ex-husband, Michael Bragg, said she moved to Colorado with Dear about a year ago. Michael Bragg said he had two daughters, ages 19 and 15, with Stephanie Bragg, who had worked as a waitress at a Waffle House. Bragg said he believed that his ex-wife met Dear online.

In Anderson Acres in North Carolina, neighbors said Dear had not been to his mustard-yellow shack in at least a year.

On Saturday, the shack was padlocked shut, with a fading “No Trespassing” sign outside and piles of junk inside, visible through the windows. The front door was locked with a metal cable snaked through holes drilled through the door and door frame. An empty beer bottle and empty dog bowl were all that was left on the worn wooden patio.

An outdoor shower was set up using a bucket wedged between the house and a dirt hill. Dear had set up a makeshift system to collect rainwater from the roof, draining it through plastic piping into a plastic garbage can, which was overflowing from neglect.

Neighbors said Dear bought the place about six years ago and started coming up every few days to build a plywood addition onto the side of the existing structure.

When he moved in, neighbors said they tried to welcome him, but he responded gruffly, never uttering more than a few words. And he unnerved some in this small community, made up mostly of retirees and young professionals who want a slice of the country life.

“We’re not isolationists,” one resident said. “You know how whenever someone goes crazy, the neighbors say he was so quiet and normal. That wasn’t the case here. He was weird. Everyone kept an eye on him.”

One neighbor said he recalled an incident about five years ago when Dear fell off a motor scooter, broke his collarbone and did not get medical help. The neighbor said he could see that the bone was broken, but Dear said: “No, no, I don’t need anything.”

Dear would leave two dogs abandoned and roaming through the area for days at a time, a neighbor said, and fellow neighbors complained that they had no food or water. “He would leave the dogs, and they would get aggressive,” and people were worried about their children, one neighbor said. “He was really tightly wound. You could see that from the stress on his face, from the way he acted.”

The neighbors recalled that Dear had a motor bike and a four-wheeled ATV that he would drive up and down the dirt road at high speeds, scaring the local kids.

“I’d get on him and say, ‘Look, man, you’ve got to slow down a little bit,’ ” the first neighbor said. “And he’d speed even more, like we weren’t even there. He’d just try to start confrontations all the time.”

The neighbor said that Dear would carry a stick as he rode his trail bike, and he would slow down and try to bait dogs in the area. He also said that Dear swung the stick at his dog several times.

The neighbors said that Dear’s behavior seemed to change last year, and he seemed angrier.

“The last time I saw him, I waved and smiled. He just stared and glared back at me. It was disconcerting,” one said.

The neighbors said they never saw Dear with a gun, and they never heard him speak about politics or abortion rights.

Antiabortion groups were quick to denounce the shooting and distance themselves from Dear, with many activists saying they have never interacted with or heard of him.

“He was just always saying, ‘I know the U.S. is trying to kill everybody’ and do this and do that,” said one resident here. “He [said he] was an undercover [agent]. Just craziness. Just pure, right-out craziness all the time.

“I’m kind of glad he’s put away now,” he said.

Sullivan and Jordan reported from Washington. Alice Crites in Washington and Danielle Paquette in Hartsel, Colo., contributed to this report.