The sense of urgency was palpable as the mystery persisted. The F.B.I. and the federal Bureau of Alcohol, Tobacco, Firearms and Explosives were involved in the investigation, as well as the Louisiana and Florida state fire marshals, the cybercrime unit of the Louisiana attorney general’s office, and the state and local police.

Social media posts offered a glimpse of the man they arrested.

Facebook photos of Mr. Matthews show a young man with long hair. In one picture, he is wearing a black sleeveless T-shirt and holding a black electric guitar. He described himself as the lead singer of a black metal band called Vodka Vultures, though there was little online evidence of the band’s activity. Still, he wrote several posts that showed his familiarity with the genre.

He wrote favorably of the recent movie “Lords of Chaos,” a dramatized version of the black metal scene, and apparently referenced Varg Vikernes, perhaps the most notorious figure in the black metal movement, who was found guilty in Norway of killing a heavy metal guitarist and burning three churches.

The path to Mr. Matthews was laid out in an affidavit, with the big break coming Tuesday when an A.T.F. team found a piece of what appeared to be a two-gallon red gas can at Mount Pleasant Baptist Church.

The authorities realized that the same can was for sale at a local Walmart. On Wednesday, an investigator working for the retailer shared with them that a similar can had been purchased late on March 25 — less than three hours before the first church fire — along with a package of shop towels and a lighter, all paid for with a debit card that the authorities said was owned by Mr. Matthews.

Investigators learned, too, that Mr. Matthews’s father, Roy Matthews, was a longtime deputy in the St. Landry Parish sheriff’s office and the owner of a beige 2002 Ford pickup that appeared to match the truck that “consistently” appeared “around the time of each fire,” the affidavit states.

Sheriff Bobby Guidroz of St. Landry Parish said that he had summoned Mr. Matthews’s father on Wednesday to tell him that his son was considered a suspect in the fires, which all took place in the middle of the night and did not injure anyone.