Dylann Roof is in custody after police say he opened fire at a historic African American church in Charleston, SC. Here’s a look at the 21-year-old's background, including recent arrests, and what authorities say happened inside the church. (Alice Li/The Washington Post)

Dylann Roof grew up in this rural town on the distant fringe of South Carolina’s state capital, a quiet, shy boy who mostly kept to himself. He didn’t get into trouble. He didn’t especially stand out.

At some point that changed, and Roof’s slow, aimless walk into adolescence veered off its lightly marked path. He dropped out of high school after ninth grade and didn’t return, drifting anonymously without the apparent moorings of common teenage interests.

By this year, under pressure from his parents to get a job, he was hanging around a local mall, asking shopkeepers what time their stores opened and closed in an unsettling ritual that eventually drew the attention of ­police. Then, a few months ago, Roof was arrested on drug charges as he slipped toward his alleged horrific Wednesday evening visit to Emanuel AME Church, about 100 miles southeast of here in Charleston.

Nothing had prepared his family for the shock of the crime and the images, on television screens and Web sites, of a son, nephew and brother who overnight had become the target of a nationwide manhunt that ended during a traffic stop in North Carolina.

The 21-year-old was arrested Thursday for allegedly slaying nine people in the church sanctuary, an act now under investigation as a hate crime. Law enforcement officials said the shooter rose during a prayer service, declaring that he was there to kill black people. He then fired methodically, round after round, with a semiautomatic handgun.

“The whole world is going to be looking at his family who raised this monster,” Roof’s ­uncle, Carson Cowles, said Thursday as he wiped away tears outside his mobile home here. While Roof was quiet and “did stay a lot to himself,” Cowles said, his mother “never raised him to be like this.”

The shootings occurred about 9 p.m. Wednesday at Emanuel African Methodist Episcopal Church, one of the nation’s oldest African American churches. Law enforcement officials said the weapon, a .45-caliber Glock handgun that was reloaded several times during the attack, was found on Roof when he was arrested. The gun was legally purchased in April, officials said.

After an all-night manhunt, Roof was taken into custody during a traffic stop in a residential driveway in Shelby, N.C., about 250 miles from Charleston. The man who rents the house, Matthew Johnson, said he wasn’t home at the time but was told the arrest was made without incident.

It was Roof’s sister, Amber, who called authorities after seeing the surveillance photo of her brother on television, said law enforcement officials, who spoke on the condition of anonymity, citing the ongoing nature of the investigation.

Amber Roof was due to be married Sunday, according to ­theknot.com, a wedding Web site. Although authorities haven’t said why Roof fled to Shelby, his sister’s fiance, Michael Tyo, lives three miles from where Roof was captured in a residential neighborhood of brick ranch-style houses.

Tyo, a recruiter for the U.S. Army Reserve, declined to comment Thursday while packing up his children and the family dog for what appeared to be a trip.

In the interview Thursday, Roof’s uncle, Cowles, said his nephew had no issues with African Americans. But the accounts of law enforcement officials and some of Roof’s own possessions appeared to indicate otherwise.

Read the victims’ stories

His Facebook profile shows a picture of Roof in the woods, wearing a jacket with two conspicuous patches — old flags of former regimes in South Africa and Rhodesia, now Zimbabwe, where white minorities governed majority-black populations through racist laws and brutality. For American white supremacists, apartheid South Africa and renegade Rhodesia have often stood as cautionary tales of what happens when whites relinquish their political power.

When viewed early Thursday, the profile indicated that roughly half of Roof’s Facebook friends are African Americans.

Roof invoked his own country’s racial history with the emblems he chose to display. His car featured a license plate decorated with the Confederate flag, according to a law enforcement official and one of Roof’s friends.

Roof, who lived in Eastover, S.C., not far from Columbia, also had an apparent affinity for guns. Law enforcement officials said his father recently had either bought him a gun as a present or given him money that he used to buy one.

Roof attended White Knoll High School in the suburbs of Columbia for part of ninth grade, but he left the school in February 2010, school officials said. He finished out the year at another high school in Columbia, officials said, but didn’t return.

His activities over the past few years remain unknown, but earlier this year, Roof ran into trouble with the law in two incidents at Columbiana Centre, a mall north of Columbia.

In February, according to a police report, he raised suspicion by walking into stores wearing all black and asking workers “out of the ordinary questions.” The report said the questions included queries about how many people worked at the stores and when they left work.

In response to police questioning, Roof said his parents were pressuring him to get a job. But he hadn’t picked up any job applications, the report said.

The officer who questioned Roof then found strips of Suboxone, a drug for treating opiate addiction, in his jacket pocket. Roof was arrested and charged with felony drug possession and banned from the mall. The case is pending, according to court records.

Two months later, in April, Roof was arrested again, this time for trespassing in the mall’s parking lot, according to a police report. He was found guilty of that charge May 27 and fined $262.50, according to court records.

Back in Gaston, even as he described Roof as a quiet young man who kept out of trouble, Cowles shook with anger at the thought that his nephew could have carried out the crime with which he is accused.

“I’d be the executioner myself if they would allow it,” he said.

Horwitz and Markon reported from Washington. Ishaan Tharoor, Julie Tate, Alice Crites, Jennifer Jenkins and Thad Moore in Washington contributed to this report.