The Queen has delivered a strong defence of the special relationship between Britain and the US.
The banquet had a white tie dress code
At a White House banquet, she said "the lesson of my lifetime" had been that the partnership "was always to be reckoned with" in defending freedom.
The monarch and her husband were guests of honour at the dinner hosted by US President George W Bush and wife Laura.
The five-course banquet was the first in Mr Bush's presidency to demand a white tie dress code.
Earlier, more than 7,000 people, including US cabinet and congress members, attended a reception on the White House lawns.
At the evening banquet, the Queen toasted the UK's friendship with the United States.
"Administrations in your country and governments in mine may come and go, but talk we will, listen we have to, disagree from time to time we may, but united we must always remain," she said.
Her speech looked back at the partnership between the two countries during her reign as Queen.
"I would like to recognise that steadfast commitment your country has shown not just in the last 16 years but throughout my life in support of a Europe whole and free," she said.
"I grew up in the knowledge that the very survival of Britain was bound up in that vital wartime alliance forged by Winston Churchill and President Roosevelt.
The monarch went on to say how the two countries, and those of Europe and the Commonwealth, now faced different threats.
"In recent years, sadly, both our nations have suffered grievously at the hands of international terrorism," she said.
"Further afield, whether in Iraq or Afghanistan, climate change or the eradication of poverty, the international community is grappling with problems certainly no less complex than those faced by our 20th century forebears."
She said: "Divided or alone we can be vulnerable, but if the Atlantic unites not divides us, ours is a partnership always to be reckoned with in the defence of freedom and the spread of prosperity."
Mr Bush also spoke of co-operation between the countries and said "friendships remain strong when they are continually renewed".
"Together we are supporting young democracies in Iraq and Afghanistan," he said.
"Together we're confronting global challenges such as poverty and disease and terrorism. And together we're working to build a world in which more people can enjoy prosperity and security and peace."
The Queen dressed in a white Stewart Parvin fitted bodice and chiffon skirt wore the Queen Mary tiara.
The banquet, for 134 guests, included pea soup, Dover sole and a saddle of spring lamb rounded off by farmhouse cheeses.
The Queen was earlier honoured with a 21-gun salute in Washington DC on the final leg of her six-day US visit.
The Queen earlier attended a garden party in Washington
Mr Bush, meanwhile, joked with the Queen after making a mistake in his speech.
He said: "You helped our nation celebrate its bicentennial in 17... 1976" , and then joked the Queen had given him "a look that only a mother could give a child".
The president said the UK had "written many of the greatest chapters in the history of human freedom".
He said its relationship with the US was built "on the surest foundations - our deep and abiding love of liberty".
The Queen was last in Washington in 1991 when George Bush Snr was the American president.
Earlier in the trip, the Queen fulfilled a long-held ambition to watch the Kentucky Derby at Churchill Downs, Louisville.
The royal couple's visit to the first permanent English settlement in the US, in Jamestown, Virginia, marked its 400th anniversary.
In Virginia, the Queen extended her sympathies to those affected by the shootings at Virginia Tech last month.
The tour is the Queen's first carbon-offset state visit, where a donation is made to an environmental charity to offset the plane journeys made by the royal party.
THE QUEEN'S FIRST CARBON-OFFSET STATE VISIT
Total air miles
- 13,317 km or 8,275 milesAmount of CO2 emitted based on scheduled flights
- 1. 5 tonnesEstimated offset cost per person
- £13.20 to £14.18 ($26.22-$28.17) depending on type of offset package
Source: The Carbon Neutral Company carbon calculator