MADRID — The crown prince of Saudi Arabia was on an official visit Thursday to longtime commercial ally Spain, where activists are criticizing past and possible future sales of military equipment to the kingdom.

Mohammed bin Salman was due to attend a banquet with Spain's King Felipe VI and Queen Letizia before meeting with Prime Minister Mariano Rajoy and with Defense Minister Maria Dolores de Cospedal.

The 32-year-old heir to the Saudi throne and Rajoy were scheduled to preside over the signing of bilateral agreements, according to the visit's official agenda, which provided no further details.

Amnesty International, Greenpeace, Oxfam and Spain's FundiPau have criticized a possible contract to build and sell five Navy corvettes, valued at 2 billion euros ($2.47 billion), that Spain is seeking to sign with Saudi Arabia.

In a statement sent by Arms Under Control, a coalition of the four non-profits, they urged Spain to stop exporting weapons that could be used by the Saudi-led coalition fighting Iran-backed Houthi rebels in Yemen, where the United Nations says thousands of civilians have died.

Now at the center of the Saudi kingdom's power structure, the crown prince has instigated reforms to shed its austere image, though human rights organizations have called the changes "cosmetic."

Prince Mohammed's arrival in Spain came after visits to the United States, Britain and France. Those three countries are the main exporters of military equipment and weapons to Saudi Arabia, according to the independent global security database of the Stockholm International Peace Research Institute.

The fourth position is held by Spain, which according to data drawn by the four NGOs from official sources, exported to Saudi Arabia 728 million euros' ($901 million) worth of defense-related equipment between 2015, when airstrikes in Yemen began, and mid-2017.

A consortium of Spanish companies has also built a high-speed railway between Medina and Mecca as part of strong and growing economic ties between the two countries and their royal families.

Since ascending to the throne in 2014, King Felipe VI has continued the frequent visits to Saudi Arabia that his father, Juan Carlos, made during the reign of King Fahd and his brother King Salman.