SALVADOR, Brazil - Clovis Dias de Oliveira sat behind the counter of his empty store filled with touristy knickknacks, looking at his phone, scrolling through Facebook, shaking his head. More bad news.

A pair of gangs had recently battled it out. A man had been shot. Arrests had been made. This latest violence had erupted not in some faraway slum, but right here, in the heart of this historic town's famed colonial district.

Officials have been saying Salvador, with its gorgeous beaches, colonial architecture and a unique Africa-influenced culture, could help solve one of Brazil's most enduring riddles: how to attract tourists. But Oliveira, 36, wasn't so sure.

"Even I don't feel safe here," he said, exasperated. "I've seen tourists, lots of them, robbed here. And they come, and then they never come back."

Latin America's largest country has come to a critical point in its long-troubled relationship with tourism. While many of the world's most attractive destinations are experiencing a boom, and other Latin American countries such as Mexico and the Dominican Republic are cashing in, Brazil brought in only 6.6 million foreign visitors in 2018 - fewer than theocratic Iran, fewer than conflict-torn Ukraine, fewer, even, than just the Louvre Museum in Paris.

But the tally was higher - ever so slightly - than the year before. Now the government is looking to build on it and fulfill the tourism potential of a country that boasts thousands of miles of coastline, the Amazon rainforest, mountain ranges, and a famously warm and welcoming people. By 2022, officials pledged this year, they'll double the number of foreign visitors.

Doing so would also double the number of foreign dollars coming into a country badly in need of them. Hobbled by high unemployment and economic stagnation, Brazil took in only around $6 billion from foreign tourism in 2018. The United States collected $210 billion; tiny Portugal amassed $18 billion, according to the U.N. World Tourism Organization.

Officials have eliminated visa requirements for citizens of the United States, Canada, Australia, Japan, China and Qatar. They've launched a global public-relations campaign called "Brazil by Brasil" that's papering cities in the United States and Europe with advertisements that are ambiguous yet strangely enticing: "Meet a new Brazil, modern and productive." And Brazilian President Jair Bolsonaro speaks often of tourism - venting, for example, about the environmental protections he says inhibit tourism and speaking wistfully about creating the Brazilian equivalents of Cancun and Cozumel.

"Our tourism (situation) is frustrating, in view that we are first in the world in natural beauty," Bolsonaro said this year. "We want to preserve the environment, but if any other country in the world had our marvels, it would be making billions from tourism. But we can't."

But whether the Bolsonaro administration can achieve its own lofty aspirations will be, to a certain extent, a test of whether it can get out of its own way.

The number of foreign visitors has dropped 5 percent this year amid a drumbeat of bad news and international condemnation. There were the Amazon forest fires. Then a devastating oil spill. A record number of killings by police in Rio de Janeiro. And through it all, a president who revels in political provocation - saying he'd rather have a dead son than a gay one, calling for criminals to be killed in the streets "like cockroaches," insulting the appearance of the wife of French President Emmanuel Macron.

"Bolsonaro isn't particularly appealing," said Thomas Kohnstamm, who wrote a Lonely Planet guide to Brazil, and then a tell-all memoir about the experience. "Brazil attracts more independent travelers, who are a more progressive group. So when the Bolsonaro campaign hand sign is a gun and he's saying, 'I'd rather have a dead son than a gay son,' that doesn't play really well."

For Brazil, it's no one thing that's keeping the visitors away. Turkey, for instance, also has a leader with authoritarian tendencies in President Recep Tayyip Erdogan - but the number of tourists flocking to that country has swelled from 31 million to 46 million in the past decade. Mexico, another country debilitated by violence, welcomed 41 million visitors in 2018 - nearly twice the volume of 2010.

Brazil, wedged between the Andes and the Atlantic, thousands of miles from the United States, farther from Europe and Asia, remains remote - and not only geographically. The people speak Portuguese. The culture, with its many influences, is unique. Plus, flights are expensive.

"The goal is impossible," concluded Luiz Gustavo Barbosa, who studies tourism at the Fundação Getúlio Vargas, a university in Rio de Janeiro. "It's impossible because the goal was wrong from the beginning."

The challenge feels particularly acute in the seaside city of Salvador. Founded by the Portuguese as Brazil's first capital, it is today a laboratory for the country's experimentation with tourism.

Authorities recently completed a five-year renovation of the historic district, Pelourinho, one of the largest stretches of colonial architecture in the Americas. The New York Times this year named the city one of its 52 places to explore. And according to the local airport, the number of foreign entries increased 25 percent in the first six months of this year.

"Salvador is ready for tourists," declared Claudio Tinoco Melo de Oliveira, the city's tourism director. "We're talking about Brazil's first capital. Our potential is much greater."

But parts of Salvador, one of the most violent cities in a violent country, have the hunted feeling of a town besieged. Police officers stand on every street corner, springing into action to arrest pickpockets, one of whom attempted to rob this reporter at dusk one night.

Shopkeepers complain about the constant threat of crime. "There are robberies and assaults, and then tourists stop coming!" said Tabmo Oliveira Junior, as he served gelato at an ice cream shop.

Tourists are skittish.

"Of course we're concerned," said Amavry Menanteu, a visitor from France who was waiting just outside his hotel for an Uber to avoid a risky walk. "We have to check wherever we can travel and walk, and when we arrived here, we had to ask where we could go."

"If I was here alone, I would not feel safe," said a 28-year-old woman from Germany who spoke on the condition of anonymity for fear of repercussions. "We are clearly a target; we are the whitest people here and we obviously stick out" as tourists.

But it's getting better, promised Gustavo Ribero. It has to - for Salvador's sake, and for his own. He recently took over the posh restaurant Maria Mata Mouro - which, despite the excellent food, had just clocked another slow night.

"I believe in this place," he said. "It has the most potential of anywhere in the country ... and I believe in a better future here. I've invested my life here."