Spain's prime minister and the president of the United States met for the first time at a NATO summit in Brussels on Wednesday.

Pedro Sanchez of the Socialist Party who replaced his predecessor, the conservative Mariano Rajoy after the latter lost a vote of no-confidence in parliament, greeted Donald Trump at the start of the first session of the NATO summit.

Sánchez and Trump participated in the group photograph of the leaders attending the summit, shook hands and exchanged a brief greeting.

Spanish government sources said no bilateral meeting between the leaders had been planned to occur during the summit.

Sánchez also met Theresa May, Prime Minister of the United Kingdom, and agreed to maintain a constructive dialogue over the fate of Spanish citizens living in the Campo de Gibraltar on the Spanish side of the border with the tiny British enclave on the country's southwestern tip after Brexit.

Sanchez was interested in the consequences that the UK's departure from the European Union might have on the residents of Campo de Gibraltar who work in Gibraltar.

Sanchez and May had already met at the European Council at the end of June.

Spain ceded Gibraltar’s sovereignty to Britain by treaty in 1713 but has persistently sought its return ever since.