King Felipe VI and Queen Letizia of Spain were at Atlantic College in Llantwit Major, Vale of Glamorgan, with their daughter Infanta Sofía.
Princess Leonor, heir to the Spanish throne, began her £67,000 two-year course at the boarding school in 2021.
King Willem-Alexander and Queen Máxima of the Netherlands attended to see Princess Alexia graduate.
Atlantic College has around 4,500 students and has a history of attracting overseas royals.
Spain's Princess Leonor de Borbon, 17, is the eldest of the royal couple's two daughters.
The Spanish royal couple personally paid for the tuition fees and their daughter applied for a place through the United World Colleges' (UWC) Spanish committee.
The Dutch royal house posted a picture of the king and queen with Princess Alexia, also 17, with her graduation certificate outside the college.
Executive director of UWC International, Jens Waltermann, previously said the heir to the Spanish throne was joining "4,500 other students from 155 countries, and from a diverse range of backgrounds, who will be studying at one of our 18 schools".
Atlantic College is a residential sixth form college for 15 to 19 year olds.
The college also teaches the International Baccalaureate combined with co-curricular community service activities to around 350 of its students.
Founded in 1962, the estate near Llantwit Major, Vale of Glamorgan includes the 12th Century St Donat's Castle and was once the former home of American newspaper magnate William Randolph Hearst.
Queen Noor of Jordan is college president and one of her daughters graduated from the institution.
The college has also welcomed famous visitors in the past, including the late Queen Elizabeth II, the former Prince of Wales and the Emperor of Japan.
In 2013, the college once again gained the world's attention when two Pakistani teenagers shot by the Taliban while travelling with their friend Malala Yousafzai - now a Nobel Prize laureate - were given scholarships to study there.