A Spanish court on Monday authorised Prime Minister Pedro Sánchez's wife Begoña Gómez to attend her daughter's graduation in London, after she was banned from leaving the country as part of a corruption probe.

A judge has ordered Gómez to stand trial on alleged influence peddling, embezzlement, corruption in business dealings and misappropriation of funds after a two-year-long investigation, one of several scandals threatening her husband's left-wing government.

Juan Carlos Peinado deemed Gómez a flight risk and ordered the confiscation of her passport last month while a higher court assesses his order to stand trial, for which no date is set.

A Madrid court ruled that Gómez could exceptionally receive her passport to go to London on July 8-10 but denied her request to accompany Sánchez to a NATO summit in Ankara on Tuesday and Wednesday.

"Turkey does not belong to the European Union's freedom, security and justice space, in which police and judicial cooperation in criminal matters is facilitated," the ruling said.