SAN SALVADOR, El Salvador — Walking out of prison three years ago, Marvin Ramos Quintanilla seemed to turn over a new leaf after a life of crime and gangland violence.

He got a city government job working in community development, and also ran a business selling used cars imported from the U.S. He joined an evangelical church, where his family was regularly seen worshipping, and even got ordained as a pastor.

Then on July 28, Ramos was arrested along with several alleged leaders of the feared Mara Salvatrucha gang, which has been designated an international criminal organization by the U.S. government. Salvadoran authorities also seized thousands of dollars in cash long with properties, businesses and bank accounts.

Prosecutors allege that Ramos’ new life was a front, that he used his pastoral credentials to access prisons so he could conspire with jailed leaders of the gang. Religion, they say, was a facade to mask his real work: helping run Mara Salvatrucha’s street operations and directing its finances at a key moment when gangs are facing a tough crackdown by the government and are moving to diversify their criminal operations and become more corporate in makeup and structure.

Ramos denies the allegations.

“It is not true that I am the (gang’s) financier. It is not true that I have entered the prisons. It is not true,” he said during a recent court appearance. “I had left that behind me.”

Prosecutors have presented as evidence hundreds of telephone intercepts purportedly involving Ramos, however, including one from January in which he allegedly ordered the killing of three gang members in the Izalco prison in western El Salvador.

Little is known about Ramos, including the meaning or origin of his purported gang nickname, “Piwa.” Many who have crossed paths with him are reluctant to speak openly, saying even an offhand comment about gangs can get you killed in El Salvador. Mara Salvatrucha and the rival Barrio 18 gang terrorize much of this Central American nation, which recorded the highest homicide rate last year for any country not in open war.

According to an identity document obtained by The Associated Press, Ramos was born May 22, 1980, in San Rafael Oriente, a small town about 80 miles (125 kilometers) southeast of the capital of San Salvador.

Appearing in court, Ramos, who favors a short, conservative haircut, wore a long-sleeve dress shirt that hid the arm tattoos visible when he was presented to the media the day after his arrest. Smiling, he took questions from reporters, though he gave clipped answers.

Ramos told AP he was from Soyapango, a notoriously dangerous suburb east of San Salvador that is said to be one of the country’s most fertile gang recruiting grounds. He said his parents no longer live there, but did not answer when asked if they were still alive.

He apparently joined the gang by his late teens, since in 2000 he was convicted of aggravated homicide, sentenced to 15 years and put in the maximum-security prison in Zacatecoluca familiarly known as “Zacatraz.” In March 2012, he was among a number of inmates moved to a less-strict prison as part of a truce struck with the gangs, and he was released in October 2013.

He moved back to the capital.

Salvador Ruano, mayor of the San Salvador suburb of Ilopango, confirmed that Ramos worked for his government directing a social program targeting the poor, especially youths and single mothers.

After rival gangs in Ilopango declared a peace in 2013, gang members involved in the accord “brought me this man Marvin so he could work on the process that they were calling the truce,” Ruano said.

City documents show Ramos held the title of “adviser” for citizen development from November 2013 until he was let go in May of this year.

Ramos lived with his wife, a teacher at a bilingual Christian school, and their two young children in Miramonte, a working-class neighborhood where several neighbors interviewed by AP said they hardly knew him. Nobody answered the door at his home, and a woman nearby said she believed the family had moved away.

They attended the Nazaret evangelical church, whose pastor declined through an intermediary to speak to AP.

“He was not our pastor; he only worshipped here,” said a woman at the church, who insisted on speaking anonymously for fear of gang reprisals.

She said police had been coming around the area since Ramos’ arrest and complained that street gossip was wrongly tarring Nazaret as a Mara Salvatrucha church.

“He seemed like good people. I had heard that he had left the gangs,” she said.

It was a nonprofit pastoral network called RED Torre Fuerte that gave Ramos his credentials as a chaplain in 2015 after a year of study.

“For me Marvin is a person of spirituality, and ever since I met him I have seen him as a man following the Lord,” said pastor Nelson Valdez, director of RED Torre Fuerte. He said he had no knowledge of continued gang involvement by Ramos.

Ramos was seen traveling in multiple vehicles, including luxury automobiles — something Valdez said he didn’t think twice about “because he sold used cars and that was how he made a living.”

He also was going around armed. Valdez said he learned Ramos had two registered weapons, a pistol and a .22 caliber rifle, and asked why he needed to be armed if he was now a Christian.

“He told me that some people in the gang did not like what he was doing. … When they captured him he had the pistol and another illegal one,” Valdez said.

Valdez, who is also a lawyer and represents Ramos’ wife, said she did not want to talk to the media.

Authorities say Ramos somehow obtained certificates from the prison system and the national police falsely attesting he had no criminal background, which allowed him to obtain firearm permits. Prosecutors are looking into whether he was helped by any government official.

He is also alleged to have used his RED Torre Fuerte pastoral license to gain permission to preach inside prisons, despite rules barring known gang members from visiting associates behind bars.

“We are investigating it,” Justice Minister Mauricio Ramirez Landaverde said.

Prosecutors have released the document that granted Ramos access to prisons, though he denies ever going inside.

“My work has been in the communities,” he said.

But authorities contend that after leaving jail he in fact was a main national leader for Mara Salvatrucha, overseeing everything from collecting extortion payments to coordinating arms acquisitions.

Prosecutors say during the time Ramos allegedly directed the Mara Salvatrucha’s financing, the gang used illicit proceeds from extortion and drug trafficking to diversify and quietly run, through front men, an array of businesses including restaurants, beer halls, auto import and repair shops, bus and taxi firms, strip clubs, no-tell motels and even a brothel in a high-end neighborhood of San Salvador.

Ramos is alleged to have been a key figure in a new corporate gang structure known as “The Federation,” conspiring with the traditional leadership known as “La Ranfla.”

“The members of ‘The Federation’ are gang leaders who are free, while those of ‘La Ranfla’ are imprisoned gang leaders,” Attorney General Douglas Melendez said. Ramos, he said, “was the financier.”