Spanish Prime Minister Pedro Sanchez on Sunday defended Madrid’s controversial decision to go ahead with the sale of 400 laser-guided bombs to Saudi Arabia, insisting the deal had to go through in order preserve good relations with the Gulf state, agencies reported.

His Socialist government announced earlier this month that it would block the delivery of the weapons due to concerns that the weapons could be used to kill civilians in Yemen, where the kingdom is engaged in a bloody conflict.

However, on Thursday, Foreign Minister Josep Borrell announced that the government had decided to go through with the transfer, angering humanitarian groups.

The cancellation of the deal would jeopardize a much larger order for five corvette warships worth $2.1 billion, to be built by Spain’s Navantia shipyard in the southern region of Andalusia, with thousands of jobs at stake, AFP reported.

Workers in the region, a bastion of the ruling Socialist Party, had staged protests calling for the arms transfer to go ahead.

Asked about the policy reversal during a TV interview, Sanchez said his government risked “creating the image that it was revising its entire relationship” with Saudi Arabia if it did not deliver the bombs.