The memorial gala took place at Fredensborg Palace Church to mark one year since the passing of Queen Margrethe's husband who had been married to the Danish monarch since 1967.
Australian-born Mary looked incredible in a navy knee length gown covered with floral pattern and a matching satin evening jacket pinned with a delicate brooch.
The mother-of-four paired her elegant ensemble with pointed court heels embossed with tiny studs.
She carried a small burgundy cutch and finished the look with a pair of dainty drop earrings.
The 47-year-old royal was coiffed to perfection and showed off her flawless complexion with a full coverage makeup look.
Crown Prince Frederik looked dapper in a navy suit and grey-blue tie.
Watch this video to see Princess Mary's first public appearance since receiving tragic news about the death of a family friend earlier this month
Fred's brother Prince Joachim and his wife Princess Marie of Denmark also attended the service.
Noticeably absent was Queen Margrethe herself.
The Queen has not been seen in public since celebrations for the New Year in early January.
According to Royal Central, Her Majesty is set to conduct her annual tour of Denmark on the royal yacht Dannebrog in late May.