Details are emerging about a 21-year-old white man from South Carolina who was arrested as the lone suspect in the fatal shooting of nine black people at a church in Charleston.

Charleston Police Chief Greg Mullen announced the arrest of Dylann Storm Roof, of Lexington, S.C., at a news conference on Thursday.

Roof was arrested during a traffic stop on Thursday morning in Shelby, N.C., after a day-long manhunt. A local florist phoned police when she spotted Roof in his car, Mullen said at a news conference. Photos of the suspect’s vehicle, a black Hyundai, had been circulated earlier in the day, after it was captured on video by security cameras at the church.

Mullen said Roof was “cooperative” during the arrest.

Roof’s uncle told Reuters on Thursday that the suspect received a .45-calibre pistol from his father last April, on his 21st birthday.

A friend says the 21-year-old recently told him that black people were taking over the world and that something had to be done for the white race.

Joseph Meek Jr. said Roof had reconnected with him only a few weeks ago. The two had been best friends during middle school but lost touch when Roof moved away from Lexington. Roof’s racist remarks, Meek said, came completely out of blue.

The profile photo on a Facebook page believed to belong to Roof was changed on May 21 to show him standing in front of a swamp wearing a dark jacket with several crests sewed onto it. One crest depicts the South African flag used during the apartheid era. Another is the flag of Rhodesia, a short-lived African state ruled by a white minority from 1965 to 1979. It later became Zimbabwe.

Another photo from the page shows Roof leaning on the hood of his black Hyundai with legs framing a licence plate that shows the Confederate flag. The plate reads: “Confederate States of America.”

The owner of the page has many black people on his friends list. The Facebook page does not indicate Roof had affiliations with any white supremacy groups.

While Roof did not have clear history of racist behaviour, he has had previous run-ins with police.

Lexington County court records show Roof was arrested twice recently -- once on suspicion of drug possession and another time for trespassing.

The drug arrest took place on Feb. 28 at the Columbiana Mall in Columbia, S.C. Roof was taken into custody after employees at the mall reported him for unusual behaviour and police found Suboxone, a powerful narcotic, in his bag.

Roof was banned from the mall for a year for the incident. But on April 1 he was arrested again, this time on charges of trespassing, after staff reported seeing him at the mall.

Charleston Mayor Joseph P. Riley, Jr. praised the various law enforcement agencies for working together in apprehending the suspect following Wednesday’s shooting. Riley said the suspect is “now in custody, where he will always remain.”

Surveillance footage from Wednesday shows a man resembling Roof entering the Emanuel AME Church in Charleston, S.C., around the time the massacre. Nine people were killed, including the church’s pastor, state Sen. Clementa Pinckney.

Mullen said the suspect sat in on a prayer meeting at the church for an hour before he opened fire, killing three men and six women.

Police have called the killings a “hate crime.”

With files from the Associated Press