Queen Elizabeth II spent Wednesday night in hospital after undergoing tests earlier that afternoon, Buckingham Palace has confirmed. 

The 95-year-old, who "reluctantly" canceled a scheduled two-day visit to Northern Ireland on medical advice, spent Wednesday night in hospital for "preliminary investigations" and returned to Windsor Castle on Thursday afternoon in "good spirits". 

Buckingham Palace said in a statement that the Queen's condition is not related to COVID-19. 

"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," the Palace said in a statement. 

RTÉ reports that the 95-year-old remained in hospital overnight for "practical reasons". 

The Queen reportedly canceled her visit to Northern Ireland because she was exhausted following a hectic series of public events, including a drinks reception at Windsor Castle for billionaire businessmen such as Bill Gates on Tuesday evening. 

She appeared to be in good health at the event and was seen smiling as she greeted guests. 

Queen Elizabeth II is generally regarded to be in good health for her age, aside from some stiffness in her knees. 

She was recently photographed using a walking stick during a ceremony at Westminster Abbey, the first time that she has done so publicly with the exception of a brief period between 2003 and 2004 when she used a walking stick while recovering from knee surgery. 

She last spent a night in hospital in 2013 when she was suffering from symptoms of gastroenteritis and also underwent successful surgery to treat an eye cataract in 2018. 

The British monarch, who celebrates 70 years on the throne next year, has been an energetic public figure since the death of her husband Prince Philip in April, presiding over the opening of Parliament in May and entertaining world leaders at the G7 summit meeting in Cornwall in June. 

Both Queen Elizabeth and Prince Philip spent more than a year in a strict quarantine at Windsor Castle during the coronavirus pandemic, but the Queen has made regular public appearances since the death of her husband.