London (CNN) -- U.S. President Barack Obama blended pomp and ceremony with diplomacy Tuesday on the second full day of his weeklong trip to Europe, meeting at 10 Downing Street with British Prime Minister David Cameron and attending a state dinner at Buckingham Palace to exchange toasts with Queen Elizabeth II.
The president and first lady also toured Buckingham Palace earlier in the day and visited Westminster Abbey, where crowds that had gathered along the roads outside cheered their arrival.
Obama will hold bilateral talks with Cameron on Wednesday and address the British Parliament in a speech described by a top aide as an anchor for the European trip, which began in Ireland on Monday and goes on to France for the G-8 summit and Poland.
Ben Rhodes, the deputy national security advisor for strategic communications, said Obama would reaffirm that the U.S.-British alliance and NATO are "the cornerstone of global security and the extension of the democratic values that we share."
"The United States and the United Kingdom, along with our allies, are the ones who shoulder particular burdens for global security," Rhodes told reporters. "We see that in Afghanistan. We see that in our efforts against al Qaeda. We see that of course today in Libya."
On Tuesday, a small group of protesters shouted at Obama and Cameron before they entered the prime minister's residence without speaking to reporters. About 20 minutes later, the pair emerged and left in the presidential limo.
Cameron talked up the two countries' closeness the night before the Obama visit officially began, calling the relationship "essential" and saying there is an "incredible alignment of views" between 10 Downing Street and the White House.
The two leaders were expected to discuss issues ranging from Libya and the Arab Spring uprisings to policy in Afghanistan and Pakistan and the Israel-Palestinian conflict, a senior British government official said Monday in a briefing with reporters.
Cameron and Obama did not have a "shopping list" of issues they must cover, the official said, asking not to be named talking about private discussions.
At the state dinner, the more than 170 guests, including royalty, celebrities and politicians, sat at large U-shaped table with Obama and the queen at the head.
Queen Elizabeth toasted the "tried, tested and yes, special relationship between our two countries," along with the "continued health, happiness and prosperity" of the people of the United States, as well as the first couple. The orchestra then played the U.S. national anthem. Obama, dressed in a dark tuxedo and tails for the white tie dinner, placed his hand over his heart.
For his toast, Obama mentioned the queen's long reign and the enduring links between the two countries.
"To Her Majesty the Queen," Obama said, toasting "the vitality of the special relationship between our two peoples" and quoting William Shakespeare's tribute "to this blessed plot, this earth, this realm, this England" from "Richard II." In an apparent miscue, the orchestra began playing "God Save the Queen" before Obama concluded, forcing him to speak over the music.
Earlier in the day, Obama and the first lady toured Buckingham Palace and Westminster Abbey, where they were greeted by the dean of Westminster, the Very Rev. Dr. John Hall.
Inside, Obama, with the help of two American servicemen, laid a wreath at the foot of the Grave of the Unknown Warrior, which holds the remains brought from a battlefield cemetery in Northern France in 1920.
At Buckingham Palace, the Obamas were shown around the palace's picture gallery. U.S. Secretary of State Hillary Clinton, who also was on hand, called the gallery "a feast for the eyes."
The Obamas also exchanged gifts with Queen Elizabeth and Prince Philip, the Duke of Edinburgh.
The first couple gave the queen a handmade leather-bound album with rare memorabilia and photographs that highlighted the visit by her parents -- King George VI and Queen Elizabeth -- to the United States in 1939. To Prince Philip, they gave a custom-made set of pony bits and shanks and a set of horseshoes worn by a recently retired champion carriage horse.
The Obamas were given copies of letters in the royal archives from a number of U.S. presidents to Queen Victoria. Michelle Obama also was given an antique broach in the form of roses made of gold and red coral.
"The Star-Spangled Banner" rang out across the lawn of Buckingham Palace, followed by a 41-gun salute and the distinctive drone of bagpipes, as the queen welcomed Obama on a windy but sunny spring day.
Prince Charles, the heir to the throne, and his wife Camilla, Duchess of Cornwall, had officially welcomed the Obamas to the country Tuesday morning.
The meeting took place at the U.S. ambassador's residence after the president and his entourage came to London a day early to be sure his flight was not affected by a volcanic ash cloud spreading over the United Kingdom from Iceland.
On a less formal note, Obama also joined Cameron in playing table tennis against two students during a visit to a local school. No details on the final score were made public.
Prince Charles; Camilla, Duchess of Cornwall; Prince Philip; Clinton; former British Prime Minister John Major; and actor Tom Hanks were among the guests at the state dinner Tuesday night. The ornate setting included lush red carpeting, huge floral arrangements and candelabras, with the china dating back as far as the 18th century.
CNN's Geoff Hill and Tom Cohen contributed to this report.