The 86-year-old monarch was taken to King Edward VII's Hospital in London "as a precautionary measure" Sunday afternoon and was expected to stay two days, a Buckingham Palace spokesman said, speaking with customary anonymity.

"She is otherwise in good spirits and good health," the spokesman said.

Elizabeth had already canceled a planned trip to Wales on Saturday after showing symptoms of the illness, Buckingham Palace said. All official engagements this week will be postponed or canceled.

Gastroenteritis is an inflammation of the lining of the stomach and intestines. Though commonly known as "stomach flu," it is not caused by the influenza virus, according to the U.S. Centers for Disease Control and Prevention.

Gastroenteritis is usually caused by a virus and passed person to person, said Dr. Corey Siegel, a gastroenterologist and professor at Dartmouth College's Geisel School of Medicine. But it can also be caused by bacteria, either foodborne or personally transmitted, he said.

The bug usually has to run its course. But doctors often give hospitalized elderly patients intravenous fluids to prevent dehydration, which can lead to kidney problems, Siegel said.

At 10 Downing Street, "We wish the Queen well and wish her a speedy recovery," Prime Minister David Cameron's office said,

Elizabeth celebrated her 60th anniversary on the throne in 2012 and turns 87 in April. She was last hospitalized in 2003 for knee surgery.

Her husband, the 92-year-old Prince Philip, was hospitalized three times between December 2011 and August 2012 -- once for treatment of a blocked coronary artery and twice for a bladder infection.