Prince Joachim, 28, travelled from Belgium to Spain for an internship on 26 May, the palace said.
Two days later, he went to a party in the southern city of Córdoba, before testing positive for Covid-19.
Spanish reports suggest the prince, a nephew of Belgium’s King Philippe, was among 27 people at the party.
Under Córdoba’s lockdown rules, a party of this size would be a breach of regulations, as gatherings of no more than 15 people are currently permitted.
Spanish police have launched an investigation into the party. Those found to have flouted lockdown rules could be fined up to €10,000 (£9,000; $11,100).
Everyone who attended the party is said to be in quarantine. Prince Joachim, the youngest son of Princess Astrid and 10th in line to the Belgian throne, is said to have mild coronavirus symptoms.
Rafaela Valenzuela, a representative of the Spanish government in Córdoba, condemned the party, calling those who attended “irresponsible”.
“I feel surprised and angry. An incident of this type stands out at a moment of national mourning for so many dead,” she said.
The party was first covered by Spanish newspaper El Confidencial, which cited a document from the Andalucian authorities but did not name the prince.
Belgian media have since confirmed with the palace that Prince Joachim was in Spain, where he remains.
The prince is known to have a long-standing relationship with a Spanish woman, reported to be Victoria Ortiz.
Spain is in the process of emerging from one of the strictest lockdowns in Europe. It outlined a four-stage plan on 4 May to start easing the lockdown, which saw children under 14 confined to their homes for six weeks.
The country said it was moving to a second phase from 1 June for 70% of Spaniards, leaving only major cities under tighter restrictions.
Spain has among the highest number of coronavirus cases and deaths in the world. As of Saturday, the country had 239,228 infections and 27,125 deaths, according to a tally by Johns Hopkins University.