Last year, when Tamerlan Tsarnaev spent six months in the Russian region of Dagestan, he had a guide with an unusually deep knowledge of the local Islamist community: a distant cousin named Magomed Kartashov. Six years older than Tsarnaev, Kartashov is a former police officer and freestyle wrestler — and one of the region’s most prominent Islamists.

In 2011, Kartashov founded and became the leader of an organization called the Union of the Just, whose members campaign for Shari‘a and pan-Islamic unity in Dagestan, often speaking out against U.S. policies across the Muslim world. The group publicly renounces violence. But some of its members have close links to militants; others have served time in prison for weapons possession and abetting terrorism — charges they say were based on fabricated evidence. For Tsarnaev, these men formed a community of pious young Muslims with whom he could discuss his ideas of jihad. Tsarnaev’s mother Zubeidat confirmed that her son is Kartashov’s third cousin. The two met for the first time in Dagestan, she said, and “became very close.”

Since April 19, when Tsarnaev and his younger brother Dzhokhar were publicly identified as being the key suspects in the bombing of the Boston Marathon, investigators have been trying to work out how they were radicalized to the point of wanting to kill and maim people in the U.S., the country the brothers had called home for much of their lives. (Tsarnaev was killed during a manhunt for the two men in Boston; his younger brother was shot but survived and has been charged with acts of terrorism including using a weapon of mass destruction resulting in death. If convicted, he could face the death penalty.) Much of the investigators’ attention has focused on Tsarnaev’s visit to Dagestan in 2012. It appears that investigators have only recently begun exploring Tsarnaev’s links to his cousin.

On May 5, three agents from Russia’s Federal Security Service, the agency known as the FSB, interrogated Kartashov for the first time about the Boston bombings, according to his lawyer, Patimat Abdullaeva. The FSB agents were interested in whether Kartashov and Tsarnaev had ever discussed Islamic radicalism, Abdullaeva says.

Kartashov told them that they had, but claimed that Tsarnaev was the one trying to “pull him in to extremism,” says the lawyer, who spoke to Kartashov soon after the interrogation. (It was impossible to ask Kartashov about this directly; he has been in jail since April 27 after a brawl with police in northern Dagestan, and prison officials denied TIME’s requests to visit him or have him answer questions in writing. His lawyer agreed to pass a reporter’s questions to him in jail.) In recounting her client’s replies, the lawyer said: “Kartashov tried to talk [Tsarnaev] out of his interest in extremism.”

Kartashov told the FSB roughly the same story, Abdullaeva says, and it matches the accounts of five other men in Dagestan who know Kartashov and spent time with Tsarnaev. All of them dismiss the notion that Tsarnaev was radicalized in Dagestan. Instead, the picture that emerges from their accounts is of a young man who already carried a deep interest in Islamic radicalism when he went to Russia from his home in Massachusetts. But that curiosity evolved during his visit. The members of Kartashov’s circle say they tried to disabuse Tsarnaev of his sympathies for local militants. By the end of his time in Dagestan, Tsarnaev’s interests seem to have shifted from the local insurgency to a more global notion of Islamic struggle — closer to the one espoused by Kartashov’s organization.

The Union of the Just is a tight group of activists based in Kizlyar, a town of about 50,000 people in the plains of northern Dagestan. Tsarnaev, whose parents live 90 miles (145 km) away in the regional capital, Makhachkala, often travelled to Kizlyar to stay with Kartashov and hang out with his friends. In its short history, Kartashov’s group has never been linked to any acts of terrorism. It is seen in the region as a civil-society organization, which argues that nonviolent resistance is more effective than militancy in spreading the principles of Shari‘a.

The group’s core ideology is practically the same as that of Hizb ut-Tahrir, or HuT, a pan-Islamic political party that was founded in Jerusalem in 1953 and operates freely in many parts of the world today. Both groups use the same white-and-black flags and insignia, which decorate the homes, offices and Facebook walls of Kartashov’s followers in Kizlyar. Both groups believe that Islam is not just a religion and a way of life but also an ideal political system rooted in Islamic law.

None of the men TIME spoke to in Kizlyar admit to being members of HuT; that would be grounds for arrest in Russia, because the Ministry of Justice banned the party as an extremist organization in 2003. But several members of Kartashov’s group admitted that their politics are closely aligned with those of HuT. “We have many of the same ideas,” says Mohammed Gadzhiev, who is the acting leader of the group while Kartashov is in jail. “We also believe in the restoration of the caliphates that ruled after the death of the Prophet, may peace be upon him.”

As such, they are fiercely against U.S. intervention in the Muslim world and, more broadly, the encroachments of Western liberalism. Within 20 minutes of meeting a TIME reporter, Bilyal Magomedov, one of the group’s leading members, poses a rhetorical question: “Tell me, who is not an enemy of America these days?” Asked what he thought about the Boston bombings, he offers a silver lining for the Islamist cause. “In principle, it’s good that this happened, even though the [Tsarnaev] brothers suffered,” he said. “Don’t understand me wrong, but Sept. 11 led many Americans to convert to Islam. It’s another question that people died there, sure. But people also started to wonder why this act was committed … And when the enemies of Islam try to blacken the religion, Allah creates the opposite effect. More people get interested in Islam. They get curious.”

Kartashov’s group occupies a kind of middle ground in the ultra-conservative Salafi Muslim community in Dagestan. All of the region’s Salafis are strict Muslims. But while the vast majority are peaceful and law-abiding citizens of Russia, a small minority has embraced violent jihad against the Russian state. On an almost weekly basis, Salafi militants, known in Russia as Wahhabis, attack local police and set off bombs in public places. Kartashov’s group sympathizes with the cause of these militants while renouncing their methods.

Shamil Mutaev, a former police investigator and prosecutor in the region, estimates there are about 100 active militants in the forests of Dagestan. But members of Kartashov’s group believe there are many more. “And the actions of the security services are constantly refilling their numbers,” says Gadzhiev. Magomedov agrees. “They push us, they threaten us, they say they’ll shave our beards,” he says. “Many of the people who went to the forests to fight, I know them. And you know why they went? Because of their convictions … Many of them had everything, and with God’s will, they were killed as martyrs.”

The group’s few dozen active members are a mixed bunch. Some, like Kartashov himself, are well educated, even bookish, with an encyclopedic knowledge of Islamic doctrine. Other members of the group are athletes, mechanics or former convicts with nicknames like Crowbar and Racket. (Kartashov’s nickname among his followers is the Intellectual.) A few of his associates, like Magomedov, are IT experts who run computer stores in Kizlyar. They are very active on Facebook and other social media. And their ties to the militant groups in the hills of Dagestan are often close.

One of Kartashov’s associates, Murad Abdulmuminov, is the brother of two men killed in separate shoot-outs with Russia’s counterterrorism forces in 2010 and 2012. The elder of these brothers, a former imam named Abdulmumin Abdulmuminov, was one of the leading ideologues of the militant underground in Kizlyar, according to statements released by the Russian security services in 2010. Before his death during a counterinsurgency raid that winter, he was wanted in connection with several terrorist attacks.

But for all its familiarity with militants, the Union of the Just has preferred protests to fighting. Usually, the target of the demonstrations is Russia, particularly the abuses that human-rights organizations say are frequently committed by Russian security services in Dagestan. But in October 2012, a few months after Tsarnaev left the region, the group staged a protest against the U.S. At the time, protests were raging across the Muslim world against a crude anti-Islamic film called Innocence of Muslims, which was produced in California and posted on YouTube. The largest of these protests in Russia was held in Kizlyar, and it was organized by Union of the Just. “I’m sorry to tell you. Actually, no, I’m not sorry. We burned an American flag that day,” says Gadzhiev, the acting head of the group.

All of the members of the Union of the Just that TIME spoke to were inclined to believe that the Boston bombings had been a set-up orchestrated by American security services, a common theory in Dagestan. But in Makhachkala one man who encountered Tsarnaev offered a different perspective. Although he is not a member of Kartashov’s circle, the man says he met Tsarnaev during a beach barbecue thrown by Kartashov and his friends last summer. The man asked to remain anonymous so as not to upset his acquaintances from the Union of the Just.

In June or July, toward the end of Tsarnaev’s visit, the man said he attended a cookout at a beach outside Makhachkala, just past the point where the Shura-Ozen river flows into the Caspian Sea. (He took a reporter to see the spot where the barbecue took place.) Locals often go there when the weather is good, driving as close as they can to the water and parking in a copse of white acacia trees where ravens nest by the many hundreds. The beach is littered with debris that floats in from the Caspian, but it is a fine place to grill some meat, play soccer and talk, as Tsarnaev and his friends did that summer day. (Kartashov’s friends in Kizlyar said they vaguely remembered such an outing, but declined to discuss it in detail.)

The man in Makhachkala, who was invited to the picnic by a friend from the city’s main Salafi mosque, said a group of about eight of the guests gathered around a circle on the beach and began discussing religion. Tsarnaev was the center of attention. “Folks were saying he was the champion of boxing in America,” he says. (Tsarnaev had been a successful amateur boxer.) The man remembers Tsarnaev expressing the opinion that the insurgency in Dagestan is a “holy war.” But others disagreed with him. “Some of our guys started telling him that this is no holy war, that it’s just banditry and has nothing in common with holy war,” he said. “Muslims here are killing Muslims. That’s what we explained to him.”

Eventually the man remembers Tsarnaev ceding the point. Some weeks later — the man could not recall exactly how long — many from the same group of friends, including Kartashov, gathered on the same beach again for another barbecue. This time the discussion was different. Tsarnaev also brought up the issue of holy war, “but in a global context,” the man said. They talked about the wars in Afghanistan and Iraq, as well as the civil war in Syria, which some of the men from Kartashov’s circle accuse the U.S. and the U.K. of helping to foment. “Those questions that he brought from America [about the holy war in Dagestan], those didn’t come up anymore,” said the man who attended both barbecues. And what was Tsarnaev asking about then? “Listening,” the man said. “He did more listening.”