US Central Command said the strikes were carried out “to impose heavy costs” for attacks on commercial shipping.