Queen Elizabeth II spent the night in the hospital Wednesday after she was given medical guidance to rest.

The queen returned to Buckingham Palace on Thursday around lunchtime.

Queen Elizabeth II spent time in a hospital Wednesday after being given medical advice to rest.

Queen Elizabeth II spent time in a hospital Wednesday after being given medical advice to rest. (The Royal Family/YouTube)

"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.

On Wednesday, the queen, 95, canceled a scheduled trip to Northern Ireland, and the palace said she had "reluctantly" accepted medical advice to rest for a few days. It did not elaborate.

QUEEN ELIZAEBETH WON'T STEP DOWN, WILL INSTEAD ‘PACE HER ENGAGEMENTS,' FORMER PRESS SECRETARY CLAIMS

Queen Elizabeth II visits the Coronation Street set

The hospital stay comes after the queen canceled a scheduled trip to Northern Ireland. (AP/Scott Heppell, File)

The queen is now at Windsor Castle, west of London, where she has spent much of her time since the onset of the COVID-19 pandemic last year. The decision to cancel this week's trip was understood to not be COVID-related.

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Queen Elizabeth's former press secretary, Dickie Arbiter, appeared on Thursday's episode of "Good Morning Britain" where he spoke about the monarch's decision to cancel her trip and rest. He claimed the queen won't step down from her role, but would likely have her officials "pace her engagements" moving forward.

Queen Elizabeth

Just last week Queen Elizabeth was spotted using a cane at her first major public event. Before that, the monarch had only used a cane in 2003 after undergoing knee surgery. (Arthur Edwards/Pool Photo via AP, File)

CLICK HERE TO GET THE FOX NEWS APP

Queen Elizabeth II recently used a cane for the first time at a major public event. The monarch appeared with a walking stick while she attended a Westminster Abbey service marking the centenary of the Royal British Legion, an armed forces charity last week. 

The queen had previously used a cane in 2003 after undergoing knee surgery.

Britain’s longest-lived and longest-reigning monarch, Elizabeth is due to celebrate her Platinum Jubilee — 70 years on the throne — next year.

The Associated Press contributed to this report.