John Cobin, a U.S.-born economist and former member of a neo-Confederate group, is so passionate about a free market — and about Chile — that he has devoted the past two decades to marrying the two.

But Cobin’s unusual story took a violent turn this weekend, when he drove through one of the many crowds that have paralyzed Chile in recent weeks as they protest income inequality and a high cost of living.

The 56-year-old was arrested Sunday, police said, after he repeatedly fired a gun into a crowd in the beachside town of Reñaca, seriously injuring at least one person.

“I did not do anything wrong,” Cobin said in a video filmed just before his arrest. “It was very dangerous, very scary time for me. Thankfully, I had my gun to be able to defend myself."

After speeding his pickup truck through a crowd of people, video of the scene shows, Cobin shot his gun at demonstrators five times.

The shocking incident underscores the violence that Chilean protesters have been facing at the hands of their government, and occasionally other civilians. As of Friday, at least 20 people have been killed and about 1,600 have been injured, according to human rights observers, as crowds face water cannons and tear gas and pellets are shot in close range.

The protests erupted in mid-October, when student-led strikes against a metro fare increase quickly widened into massive anti-government demonstrations that blocked off streets and set subway stations aflame. Even as the Chilean government reshuffled its cabinet and increased taxes on the wealthy, crowds have continued to rail against decades of neoliberal economic policies, including the privatization of water, highways and the pension system.

It was those policies that first made Chile such an attractive destination for staunch free-market Americans like Cobin.

A professor with a PhD in public policy, he moved his family to Chile in 1996, setting up a business to help other recent arrivals from the Anglophone world and teaching courses at Andrés Bello National University.

In the United States, he had grown sick of political correctness, eroding family values and high taxes, and his attempts at political relevancy had proved futile. He had participated in the League of the South, a neo-Confederate hate group, and failed in his libertarian bid for a U.S. congressional seat in South Carolina. Days before the election, he was arrested on charges of domestic violence.

In Chile, however, he emerged as a prolific conservative commentator, hosting a talk radio show called “Red Hot Chile,” traveling to every major town around the country and remarrying a Chilean woman. He dubbed himself the “biggest neoliberal in the entire country.” (Chilean media outlets would later describe him as a white supremacist.)

In 2012, he helped three other Americans found a libertarian compound in the mountains, Galt’s Gulch, named for the fictional capitalist haven in Ayn Rand’s “Atlas Shrugged.” Cobin quickly split and founded a competing sustainable farm and libertarian compound, called Freedom Orchard.

A brochure for the mountainside compound advertised an idyllic 400-unit paradise, where “liberty-loving people from all over the world” could enjoy low taxes, organic produce, and freedom from “intrusive and abusive government meddling.” One group, however, was not welcome on his orchard: liberals from the United States.

“You’ve already messed up your country,” Cobin told Mother Jones in 2014. “We don’t need you.”

In countless interviews and letters to the editor, he also expressed a particular admiration for the anti-communist policies of Augusto Pinochet, Chile’s disgraced former military dictator. Cobin established ties with Hermógenes Pérez de Arce, a widely read — and to his opponents, widely reviled — conservative newspaper columnist known as one of Pinochet’s most prominent defenders. (Pérez de Arce, who could not be reached for comment, is serving as Cobin’s lawyer.)

In an undated video circulating on social media, Cobin had even spoken about eliminating the “communist plague."

“When they show off machetes, we’ll have the most massive firearms legally allowed in this country, and shoot to kill,” he said. “Not shoot at their legs, [but] straight in the heart so no witnesses are left.”

On Sunday, it seems as though he got close.

In a since-deleted YouTube video he sent to his online followers, Cobin recounted how he had been driving to a gun range when he stumbled through protesters in Reñaca, a beachside resort town about 20 minutes north of Valparaíso, the country’s third-largest city.

According to Chilean news reports, about 2,000 people were protesting along a main road, partaking in a tactic in which they stop cars and ask drivers to dance with them as a show of solidarity. Cobin, wearing a neon yellow vest, refused. He started speeding through the crowd instead.

As Cobin tells it, the mob began banging against his pickup truck when he took out his gun and loaded it. He was fending against the possibility of assault, he said, as he began firing.

“I was in fear for my life, being attacked by a violent mob,” he said.

Video of the incident, however, showed a largely isolated vehicle moving past the crowd. After Cobin opened fire, a barefoot protester threw an object toward Cobin, who responded with more shots in the direction of the demonstrators. One of his bullets hit someone in the thigh, reportedly landing that man in the hospital.

As footage of the incident circulated around Chilean social media, Cobin was identified and doxed, his address and phone numbers released on social media. His phone was ringing off the hook, he said, as police came to his home to arrest him.

“We will not tolerate that anyone, regardless of their condition or belief, use firearms to impose their ideas,” said Jorge Martínez, the governor of Valparaiso. Cobin is set to be presented on Monday on charges of attempted murder and severe injuries, even as many critics say government forces have gone unchecked for the same sort of violence.

Late Sunday, another trace emerged on social media: Cobin had taken a selfie with the police officers who arrested him.