The Duke and Duchess of Cambridge ended months of intense speculation by announcing that they are expecting their first child – one that will instantly become third in line to the throne. But they were forced to share their news earlier than hoped, even with members of their own family, because of the duchess’s admission to hospital on Monday.

News that the duchess is in the “very early stages” of pregnancy was officially released after she was taken to the King Edward VII hospital in central London, suffering from hyperemesis gravidarun – very acute morning sickness. It is understood that she is less than 12 weeks pregnant, but officials were forced to go public because of fears that her hospitalisation would fuel concerns over her health.

The Queen, Prince Charles and other members of the royal family were only told about the pregnancy on Monday.

The duchess was staying with her parents, Carole and Michael Middleton, in Bucklebury, Berkshire, when she became unwell. She was driven to the hospital by private car by Prince William, who stayed with her until he left at 8.30pm.

St James’s Palace said: “The Duke and Duchess of Cambridge are very pleased to announce that the Duchess of Cambridge is expecting a baby.

“The duchess was admitted this afternoon to King Edward VII hospital in central London with hyperemesis gravidarum. As the pregnancy is in its very early stages, her royal highness is expected to stay in hospital for several days and will require a period of rest thereafter.”

Hyperemesis gravidarum is a rare condition causing severe vomiting during pregnancy, which can cause dehydration, weight loss and a build-up of toxins in the blood or urine. It requires supplementary hydration and nutrients and affects about 3.5 out of 1,000 pregnant women.

Members of both families were said to be delighted at news that the couple are to be parents.

It will be the Queen’s third great-grandchild, but it will be the first time in almost 120 years that a serving monarch will experience the birth of a great grandchild in direct succession to the throne. In 1894, Queen Victoria, who reigned until 1901, became great-grandmother to Edward VIII. He later abdicated over his relationship with Wallis Simpson.

It will be a first grandchild for Prince Charles, and also for the duchess’s parents.

A proposed radical shakeup to the monarchy’s rules of succession means this latest member of the royal family will become third in line to the throne regardless of its gender or that of the duchess’s future children. Until such changes, a female heir could have been superseded by a younger, male heir.

The birth will push Prince Harry down to fourth place in the line of succession. Harry, who is serving in Afghanistan as an Apache helicopter co-pilot gunner, is believed to have been informed of the news by email.

Speaking on Monday outside No 10, David Cameron described it as “absolutely wonderful news” and said the couple would be “absolutely brilliant parents”.

The prime minister said he had been informed shortly before the public announcement. “I got a little note coming into a meeting I was having and I found it quite difficult to keep it to myself,” he said.

The Labour party leader, Ed Miliband, tweeted: “Fantastic news for Kate, William and the country. A royal baby is something the whole nation will celebrate.”

William’s uncle, Earl Spencer, brother of Diana, Princess of Wales, welcomed the announcement: “It is wonderful news and I am thrilled for them both.”

In Scotland, where the couple are officially known as the Earl and Countess of Strathearn, the first minister, Alex Salmond, sent “warmest congratulations” and “sincere best wishes”. “Everyone in Scotland will join me in wishing the couple the very best as they prepare for the birth of their first child,” he said.

The archbishop of Canterbury, Dr Rowan Williams, who conducted the couple’s wedding ceremony, said: “The whole nation will want to join in celebrating this wonderful news. We wish the duchess the best of health and happiness in the months ahead.”

One area of speculation is over what surname the child will take. William uses the name Wales professionally in the armed forces and is Prince William of Wales, taking the name from his father’s title of Prince of Wales.

In that fashion, his children might use Cambridge on occasion. It is also likely that if the couple have a son, the baby would one day also be Prince of Wales, although that is not automatic. Another name legally used by senior royals descended from the Duke of Edinburgh is Mountbatten-Windsor.

The duchess, whose last public engagement was at her old prep school, Pangbourne in Berkshire, on Friday, has cancelled a number of engagements she was due to undertake this week. Teachers and pupils at the duchess’s old school, where she showed off her hockey skills and then had lunch, said they had “no inkling” of her pregnancy.

Royal births are usually celebrated with a royal salute of 41 guns and with an official notice attached to the railings of Buckingham Palace, but the news is also likely to be officially posted on the monarchy’s websites, on Facebook and Twitter accounts. When William was born in June 1982, thousands of people gathered outside Buckingham Palace to wait for the announcement.

During her pregnancy, it is likely the duchess will be attended to by the Queen’s gynaecologist, who is currently Alan Farthing, the former fiance of the murdered television presenter Jill Dando.

Protecting their child’s privacy will be of paramount importance to the duke and duchess. But, with their baby destined to wear the crown one day, there is likely to be an acceptance that media will be given access, especially on milestone occasions such as the first day at school.

The pregnancy will be seen by royal aides, and fans, as an appropriate and fitting end to the Queen’s diamond jubilee year.

Since their marriage in April 2011, there has been daily speculation over whether Catherine was pregnant.

Photographs have been analysed and rumours have made magazine covers across the globe. One of the latest fortuitously speculated on whether her recent adoption of a flick-fringe hairstyle was indicative of an imminent announcement. Last week the duke gave his own clue on a visit to Cambridge when he was handed a romper suit featuring a picture of a helicopter and the slogan “Daddy’s little co-pilot”. The duke said: “I’ll keep that.”

Announcing the proposed abolition of an ancient rules of primogeniture in October 2011, Cameron said the 16 Commonwealth countries where the Queen is head of state had agreed to give female royals the same rights of succession as their brothers.

William Hague, the foreign secretary, told ITV’s The Agenda programme last night: “They [the other countries] didn’t object but they all have their different legislative procedures and in some countries, because they have to change the constitution, other people can suggest other changes to the constitution. It’s not as straightforward as it looks but clearly this has to be done quickly.”

Nick Clegg said the government was “working right now” to “put the finishing touches to legislation which will update the very old-fashioned rules of succession, which mean that if they have a baby girl, regardless of whether the baby girl then has younger brothers in the future, she will be able to succeed to the throne.

“So it’s a very exciting day, but also we’re making sure that if it is a baby girl, she can be our queen.”

Congratulations to you both, and may you both have a beautiful family life. I am sure Prince William will be a great father like is lovely mother was for him and his brother so is the Duchess will be a great mum. God’s blessing be upon you always

God Bless the Duke and Duchess of Cambridge and the child that the Duchess is carrying!

I pray and hope that all goes well with the Duchess during her pregnancy despite her severe morning sickness and bedrest she will require while she gets through her first trimester of her pregnancy!

Prince William it is a good thing you picked up the baby jumper that says “Daddys little Co-Pilot”! As your beautiful baby will need it when your child is born by your wife the Duchess of Cambridge!

I am sure your mother Princess Diana who is looking down from heaven at her son and his wife is very proud of you and your beautiful wife and praying for you both and your child that all goes well with you and your wife the Duchess and your tiny baby that she carries and you both love and worry about your wife and the child she carries!

God Bless the Duchess of Cambridge and the beautiful child she carries who will have the good looks of both its parents!

Wishing you both the Duke and Duchess of Cambridge and the baby that will arrive after the Duchess long bed rest!

I Pray for all of you with all of my heart the Duke and Duchess of Cambridge and the small baby that will be born a few months from now!

Oh I have been hoping and praying for a little one for you two. Prince William and Princess Catherine, you are going to have a beautiful baby. Catherine please take care and get plenty of rest. I went through this with my first and second child. Your baby will be just fine.