The Queen spent Wednesday night in hospital for preliminary medical checks and is now back at Windsor Castle, Buckingham Palace has said.
The 95-year-old monarch returned from the private hospital in central London at lunchtime on Thursday and is "in good spirits", the palace added.
The Queen had cancelled a visit to Northern Ireland on Wednesday.
She was given medical advice to rest for a few days after a busy schedule of public engagements.
In a statement on Thursday night, Buckingham Palace said: "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."
In pictures: The Queen's busy October schedule
Royal Family tree
Queen cancels Northern Ireland trip on medical advice
Queen declines Oldie of the Year award
The Queen travelled by car to the King Edward VII's Hospital in Marylebone, about 19 miles (32km) from Windsor, where she was seen by specialists. Her admittance is understood not to be related to coronavirus.
The overnight stay was said to be for practical reasons and the Queen was back at her desk undertaking light duties on Thursday afternoon.
It is the first time the Queen has stayed in hospital since 2013, when she suffered symptoms of gastroenteritis.
The King Edward VII's is a private hospital used by senior royals - including the Queen's husband, the late Duke of Edinburgh, who received treatment there earlier this year.
The news on Wednesday that the Queen would have to cancel a trip to Northern Ireland was always going to cause concern.
Despite looking very well and happy at the numerous events she has attended over the past week, it cannot be forgotten that she is 95 years old.
It is a tricky balance for the palace to release enough details about the Queen's health to keep the public informed while maintaining the privacy to which she is entitled.
It was for this reason that the news that she had been taken to hospital for tests was not announced, until a report on the Sun newspaper's front page forced the palace's hand.
People will be concerned, but the reassuring guidance remains that she is in "good spirits" on her return from hospital and is well enough to undertake some light duties.
It has been a busy period of official engagements for the Queen.
An official record of the Queen's diary showed at least 16 formal events during October, and there had been the plans for her to embark on the two-day trip to Northern Ireland this week.
She was pictured hosting a Global Investment Summit at Windsor Castle on Tuesday evening alongside Prime Minister Boris Johnson.
However, on Wednesday a Buckingham Palace spokesman said the monarch had "reluctantly accepted medical advice to rest for the next few days".
He said the Queen was "disappointed that she will no longer be able to visit Northern Ireland" - which would have involved an overnight stay.
The Queen's October engagements
The Queen began the month in Scotland, planting a tree with the Prince of Wales at the Balmoral Estate on 1 October and attending the opening of the sixth session of the Scottish Parliamentin Edinburgh the following day.
Prince Charles and the Queen planting a tree
The following week, she met members of the Canadian military at Windsor Castle on 6 October and attended the launch of the Commonwealth Games baton relay at Buckingham Palace on 7 October.
The Queen is expected to lead a royal delegation to the Glasgow COP26 climate change summit in two weeks' time.
In reported remarks overheard at an event last week, she appeared to suggest she was irritated by people who "talk" but "don't do" when it came to protecting the environment.
Earlier this week, the Queen declined a magazine's award of Oldie of the Year, saying "you are only as old as you feel".
She "politely but firmly" turned down the award, but sent the Oldie magazine a message with her "warmest best wishes".