London CNN  — 

Queen Elizabeth II spent Wednesday night at a hospital while undergoing “preliminary investigations,” according to a Buckingham palace spokesperson, after abruptly canceling a planned trip to Northern Ireland this week.

The 95-year-old UK monarch entered the hospital on Wednesday and returned to Windsor Castle on Thursday, the spokesperson’s statement read.

“Following medical advice to rest for a few days, The Queen attended hospital on Wednesday afternoon for some preliminary investigations, returning to Windsor Castle at lunchtime today, and remains in good spirits.”

She had been due to attend a church service in the city of Armagh on Thursday marking the centenary of partition and Northern Ireland’s foundation but “reluctantly” accepted medical guidance to cancel the trip, the palace previously said.

She is still expected to attend the COP26 climate conference in Glasgow, Scotland, later this month.

A source with Buckingham Palace told CNN that the hospital visit was not initially announced because it was going to be a short stay, and noted that the Queen is entitled to medical privacy.

The overnight stay at the hospital was for practical reasons, the source said, adding that a cautious approach was being taken by the medical team.

The Queen was back at her desk Thursday afternoon and undertaking light duties, the source also said.

She is the world’s longest-reigning monarch, presiding over the nation for almost seven decades. Earlier this week, the Queen turned down a magazine’s attempt to award her the title “Oldie of the Year,” saying she felt too young at heart.

“Her Majesty believes you are as old as you feel, as such The Queen does not believe she meets the relevant criteria to be able to accept, and hopes you will find a more worthy recipient,” read a letter from her assistant private secretary, Tom Laing-Baker, to the magazine.

This is a developing story.