That mayor, José María González, is from Spain’s far-left populist party, Podemos, and has long considered himself an anti-war activist. In 2015, he publicly advocated for cutting all commercial ties with Saudi Arabia. But with a contract at stake that would fund thousands of jobs and sustain Cádiz’s military shipyard for years, González was clear about his views. “Bring on the [weapons] contracts,” he wrote in an op-ed following the episode.

The move took many in the Spanish defense industry by surprise. Days later, a threat rippled through the Spanish press, which quoted unnamed Saudi sources saying that a larger defense contract — Spain’s biggest ever, to build five ships for the Saudi navy, worth over $2 billion — might be canceled in response. The press called it a diplomatic crisis; the government scrambled. Among calls for Robles’s resignation, the prime minister stepped in with assurances that the bomb sale would go through. The king of Spain called the Saudi crown prince, Mohammed bin Salman. Shipyard workers took to the streets in protest, and the mayor of Cádiz, the small Spanish city where the ships were supposed to be built, came out in defense of the arms sales.

In September, the defense minister of Spain abruptly canceled the sale of 400 laser-guided bombs to Saudi Arabia. The minister, Margarita Robles, cited concerns that the American-made bombs were likely going to be used against civilians in the ongoing war in Yemen, in violation of both the sale agreement and of Spanish law. Indeed, the same sort of U.S. bomb had been used in August in an airstrike on a school bus that killed dozens of children .

In his op-ed, the mayor of Cádiz sought to explain his reasons for supporting the arms sales. Spanish workers, González wrote, were being forced into this situation by economics, politics, and Saudi strong-arm tactics. They were being forced “to decide between defending bread and defending peace.”

Andrew Smith, a spokesperson for the U.K.-based Campaign Against Arms Trade, said that left-leaning leaders in those countries have long been in favor of the arms trade. “French socialist governments have never been more likely to curb arms sales than liberal or conservative governments,” he noted by way of example.

Of the four largest European weapons exporters, only Germany has stopped sales to Saudi Arabia – and that came in response to the killing of Saudi journalist Jamal Khashoggi. (The U.S. Senate also recently voted to cut off military support for Saudi Arabia in the conflict, though the measure is unlikely to get past the House and White House, and the United States is still Saudi Arabia’s top weapons supplier .) The three others biggest sellers — Britain, France, and Spain — continue their exports with ample popular political support.

Spain’s prime minister, Pedro Sánchez, also publicly supported the contract. While members of Sánchez’s party, Spain’s center-left Socialist party, were voting in the European parliament to cut all military sales to Saudi Arabia, Sánchez reauthorized the sale of the laser-guided bombs. Spain and Saudi Arabia have close economic ties, including over $2 billion in arms exports each year. And among European leaders, Sánchez wasn’t alone. Many European governments, including those led by left-leaning parties, are still selling arms to Saudi Arabia despite increasing international outrage over alleged war crimes and human rights violations in the Yemen campaign.

Cádiz is a small, sleepy island port on the south coast of Spain, and a key city in the Spanish arms industry. Sixty miles from the Strait of Gibraltar and next to the American and Spanish joint naval base in Rota, the city is famous for its cured tuna, its flamenco, and its naval destroyers. Shipbuilding is a lifeline for Cádiz and small cities on the other side of the bay, such as San Fernando, where Spain has been building warships since the 18th century.

Navantia, the Spanish national shipbuilder, will soon start work in San Fernando on an order from the Saudi navy for five corvettes — midsize warships with top-of-the-line communications technology, large canons, and missile-launching capabilities. The first ship is scheduled to be delivered toward the end of 2019. The contract is worth $2 billion and 6,000 jobs over five years. After the news broke that the deal was in jeopardy, workers at Navantia in San Fernando walked off the job and blocked a nearby highway in protest.

A few months later, Navantia was gearing up to start work on the Saudi contract. When I met him recently outside the shipyard in San Fernando, Jesús Peralta, head of the workers’ committee and one of the people who organized the protest, said he didn’t see a problem with selling weapons to Saudi Arabia, even if they will eventually be used in Yemen. Peralta likened it to selling weapons to any other country in conflict. Besides, he argued, if it’s not Spain selling the bombs or building the ships, some other country is going to do it. “A contract of this size is a huge breath of air for people here,” he said.

“We’ve been making military ships for 300 years,” Peralta added. “We’ve made ships for whole world — but we just build them. What they do with them is their problem.”

Not everyone at Navantia agrees. Joaquin Ruiz and Jose Anton Ortega have been building ships in San Fernando for about three decades each. Ruiz works on hydraulic systems and Ortega is a machinist. Both have worked on plenty of international contracts before, but never one that was so close to an active conflict. “We’re not going to feel good about building these ships,” Ortega said, “knowing that as soon as we deliver they’ll be firing on people.”

But the two men also admitted that, given a choice between building ships for the Saudi navy or leaving Navantia, both plan to stay on the job. Cádiz is one of the poorest regions of Spain; unemployment rates here have hovered around 30 percent for most of the last decade. “Right now, the only way out is this,” Ruiz said, referring to the military contracts. “There’s nothing else.”

Cádiz has a long industrial history of building ships, cars, and airplanes, said José Ruiz-Navarro, an economist at the University of Cádiz, and Cádiz shipyards have long prioritized military contracts over civilian ones.

“There is a supply of work that is ethically hard to justify, but that market is there,” Ruiz-Navarro said. “The underlying problem isn’t whether or not to sell ships to Saudi Arabia; it’s that we can’t support the workforce that we have here. That’s Cádiz’s real problem.”

Both Ortega and Ruiz, the workers from Navantia, said they would like to see company directors start to be more judicious about their clients. Building ships for the Spanish navy or allies that are not in conflict is one thing, they said; the Saudi situation is another. “Rejecting jobs like this would be the ideal option,” Ortega said. “It would be more logical and more righteous.”

There was another time where workers in San Fernando were set to work for a repressive government and responded differently. In July 1977, a ship belonging to Chilean dictator Augusto Pinochet, the Esmeralda, docked in San Fernando for repair. The ship was notorious as a site for the detention and torture of political prisoners at the hands of Pinochet’s regime.

Then, workers also walked off the job in protest. They shut down the shipyard for days, refusing to work on the dictator’s ship. “In 40 years,” said Ruiz, “we’ve gone from refusing to work on ships of that nature to protesting in the streets for contracts to build more of them.”

After the protests, González, the mayor, came out in favor of the Saudi contract. His position was a difficult one to argue: In one sentence, he declared himself anti-war and against absolute monarchies, and in the next, he defended the sale to Saudi Arabia of ships that will likely be used in Yemen.

González refused multiple requests for comment. Others from his party, Podemos, the far-left populist party founded in 2014, which is now the third-biggest electoral force in Spain, do not share his opinion. Days after the protests, the national leader of Podemos called for all arms sales to Saudi Arabia to be frozen. Months earlier, Podemos had issued a full-throated condemnation of the Saudi-led war in Yemen, citing “three years of indiscriminate bombings of the civil population.” But the mayor has not backed down.

“Whether or not we build those ships in Cádiz, it’s not going to solve the problem of this war,” González told a Spanish TV reporter. “If we don’t build those ships, will the war in Yemen end? One way or another, those ships will get built.”

Sara Cantos, a journalist from Cádiz who covers the city for a local daily, said she wasn’t surprised when González came out in support of the arms sales, especially given the local and regional elections this year.“The mayor was trapped, in a way, by the state of the city and his own electoral interests,” Cantos said. “He knew that for many in Cádiz, it would have been unforgivable for him to not support the shipyards.”

When the news first broke that the sale of the laser-guided bombs would be canceled, it was initially reported that the prime minister, Sánchez, had signed off on the order. Later, the administration claimed that the defense minister had acted on her own. By the end of the episode, Sánchez stated that he had reinstated the sale because he was “prioritizing” Spain’s relationship with Saudi Arabia and the shipyard jobs in Cádiz.

For Sánchez’s Socialist party, this was a new position. In 2007 they passed a law seeking to limit the sale of Spanish arms to countries involved in human rights violations. Responding to criticism, a minister from Sánchez’s cabinet stated that laser-guided bombs won’t be used against civilians in Yemen. (The party did not respond to repeated requests for comment.)