Denmark’s Queen Margrethe II has tested positive for the coronavirus after attending the funeral of Britain's Queen Elizabeth II, the royal palace said Wednesday.

In a statement, the royal household said that Margrethe, 82, who has been on the throne for 50 years, canceled her official duties after the Tuesday night test.

The palace said her oldest son, heir to the throne Crown Prince Frederik, and his wife, Crown Princess Mary, would take the queen's place hosting a dinner with Danish government officials and members of parliament.

PRINCE HARRY WAS 'VERY WELL PROTECTED' DURING QUEEN ELIZABETH'S FUNERAL AMID SECURITY CONCERNS: ROYAL EXPERT

Margrethe previously tested positive for the virus in February. At the time, the palace said she had received three doses of a COVID-19 vaccine. The queen was among the dignitaries who attended Queen Elizabeth II's funeral Monday at Westminster Abbey in London.

Danish Queen

The Queen of Denmark is seen here at Queen Elizabeth II's funeral at Westminster Hall, in London, on Sept. 18, 2022, just days before testing positive for COVID. (John Sibley/Pool via AP, File)

Margrethe's half-century reign makes her Europe’s longest-serving monarch following the Sept. 8 death of Elizabeth, 96, who ruled for 70 years.

Out of respect for the late British monarch, Margrethe had asked her court to adjust the Sept. 10-11 program for her own 50-year anniversary commemorations. Among the events she canceled at short notice was appearing on the Amalienborg Palace balcony to greet well-wishers and a ride in a horse-drawn carriage through Copenhagen.

CANADIAN PM TRUDEAU SLAMMED FOR SINGING ROCK SONG DURING QUEEN'S MOURNING PERIOD: 'AN INTERNATIONAL DISGRACE'

Margrethe was proclaimed queen on Jan. 15, 1972, a day after her father, King Frederik IX, died following a short illness.