DAKAR, Senegal — It was almost noon in the capital of Burkina Faso when the man in black walked onto an army base, carrying only a backpack.

Guards shouted: Freeze! The West African nation was deep into a four-year conflict with Islamist extremists who targeted military camps and were known to detonate suicide blasts.

But the man kept moving. Witnesses later described his behavior as “erratic.” Soldiers fired two shots, striking him in the arm and thigh, the Burkinabe military said. What they found in his bag made the unusual event even stranger: a U.S. passport.

The man — an American, U.S. officials confirmed — died hours later at a nearby hospital in late November and became the subject of global fascination online. He did not appear to be carrying a weapon, according to the military’s report. He had been in the country for less than three months.

“What were you doing here, bro?” asked JT the Bigga Figga, an American rapper and YouTube vlogger who lives in Burkina Faso. “What could you have possibly been doing here?”

Tourism in the nation of 20 million virtually evaporated after fighters loyal to al-Qaeda and the Islamic State began ambushing rural villages and attacking hotels that catered to Westerners.

The State Department advises Americans to avoid Burkina Faso due to “COVID-19, terrorism, crime and kidnapping.” Expatriates in the country tend to work for aid groups or companies with private security. But the man who entered the Baba Sy barracks on Nov. 21 appeared to have come alone, rousing suspicions that he sought to join an extremist group.

Now his family wants to tell their side of the story.

His name was Jerry Lamont Cole. He was 41, struggling with schizophrenia and seeking a fresh start.

“He wanted to build a better life for himself,” said Jeremy Cole, his younger brother in Texas. “He wasn’t just some ‘erratic’ person.”

He did not speak French, his brother said, which could help explain the tragedy. Maybe he was confused.

Soldiers saw Cole as a “suspect,” according to the military’s report. They had fired warning shots, the report said, and he tried to run away.

Police had detained Cole the day before for trespassing on another government property, a U.S. official said. Local authorities released him with a warning after determining he was not a threat, said the official, who spoke on the condition of anonymity because he was not authorized to discuss the matter publicly.

The State Department declined to provide details of Cole’s arrest and death. “When a U.S. citizen is detained overseas, the Department of State works to provide all appropriate consular assistance, as was done in this case,” a spokeswoman said, speaking on the condition of anonymity in line with department protocols. U.S. Africa Command declined to comment on the specifics of Cole’s case.

Cole approached the barracks at a particularly tense moment — the eve of Burkina Faso’s presidential election. Extremists had threatened to remove the fingers of anyone who tried to vote. Earlier that month, they had killed 13 soldiers in a northern province.

The conflict has steadily worsened since fighters spilled over the border from Mali in 2016. At least 425 Burkinabes have died this year in attacks, according to the Armed Conflict Location and Event Data Project, which tracks casualties.

Cole had never mentioned extremism before moving to Burkina Faso in September, said his brother, the family’s spokesman.

He was a gentle man who followed a strict vegan diet, he said. Raw vegetables only. He had pet turtles named after the Ninja Turtles. He practiced meditation. He talked about aligning his chakras.

Signs of mental illness surfaced in his early 20s. He’d jump from a normally rational mind-set to utter paranoia, which made it difficult for him to maintain a job.

Over the years, Cole picked up a list of criminal charges — possession of marijuana, disorderly conduct, resisting arrest — and sought help for his mental health. He lived on social security payments in Washington, D.C., after being diagnosed with schizophrenia, his brother said, and had recently received thousands of dollars in back pay.

By this summer, Cole could barely stand living in the United States.

The racism that long bothered him, a Black man, was all over television after George Floyd’s death sparked global protests, Jeremy Cole said.

“With the state of politics, he thought the world was becoming a less safe place for people who look like us,” he said. “He wanted to be somewhere he could feel safe again.”

Meanwhile, his paranoia was spiking. Someone bugged his apartment, he told his family. He wanted to leave the country as quickly as possible.

Cole had expressed curiosity about Africa before discovering the YouTube channel of JT the Bigga Figga, the American rapper who moved to Burkina Faso last year.

The California-born artist, whose legal name is Joseph Tom, lauds the country as a creative haven to his 34,000 YouTube followers. He fell in love with Burkina Faso, he said, after a local philanthropist invited him to visit.

He tells Black Americans: There’s no racism here.

Cole contacted him in July.

“He said that he was trying to get out of America,” Tom said. “That America is starting to become a place that he don’t want to be anymore. And that’s what 90 percent of the people are saying, man — there’s too much violence in the community.”

The rapper sold him a small plot of land — future house included — for about $7,000, he said.

Video shows Cole talking excitedly about the project.

“It’s in the making of being built,” he says in one recording. “I just bought my land. That’s the start. I’m glad to be here around real brothers, man. The real Black community.”

Cole didn’t reveal much about himself, though. He seemed guarded and spoke of “agents” trailing him, Tom said.

“He said: I’m a leader like you, you know what I mean?” he said. “Like, I can make it here without you. I don’t want you to feel like you’re babysitting me.”

Tom saw him as odd but stable until he got arrested for trespassing. Cole called him from detention, he said.

“They interviewed him and recognized, ‘Okay, well, he didn’t do nothing. He just didn’t know where the hell he was supposed to be,’ ” Tom said. “So they let him go, right? Then the next day, he went back somewhere else and that’s when he got killed.”

Tom vented on his YouTube channel: “What were you doing here, bro?”

Then he heard from Cole’s family, he said, and it started to make sense.

“It was clearly his disorder that caused him to do what he did,” the rapper said.

Construction never started on Cole’s house in Ouagadougou, so Tom sent his money to the family’s GoFundMe.

They’re using it to bring him home.

Wilkins reported from London.