Both vaccinated with three jabs, they had "mild symptoms" and were "feeling well under the circumstances", the court said, adding that they were isolating at home.
Daily coronavirus infection rates have increased sharply in recent weeks in Sweden.
The Nordic country hit an all-time high of 11,507 Covid-19 cases in a day on 30 December, topping the previous record of 11,376 from December 2020, figures released Tuesday by the Public Health Agency showed.
Daily case rates have since dropped slightly to hover around 10,000.
Other members of Sweden's royal family have already caught the novel coronavirus.
In March 2021, Sweden's crown princess Victoria and her husband prince Daniel tested positive, and prince Carl Philip and his wife Princess Sofia tested postive in the fall of 2020.