"We are marking six decades of living proof that public service is possible and that it is a place where happiness can be found," Williams told the royals and dignitaries filling the vast landmark church designed by Christopher Wren in the 17th century.
The queen returned to Buckingham Palace in the afternoon, braving the first few drops of rain in an open carriage, later to appear on the palace balcony with the present and future of the monarchy: her heir, Prince Charles, and his wife, Camilla, Prince William, the second-in-line, and his wife, Kate, and William's brother, Prince Harry.
There were more cheers as a noisy Lancaster bomber, four Spitfire fighters and a Hurricane fighter all recalling the nation's battle for survival in World War II emerged from the leaden skies to fly over the palace. They were followed by nine jets spewing red, white and blue smoke.
The crowds, forming a sea of bobbing umbrellas, stretched all the way down the Mall, the wide road leading to Buckingham Palace. As the Irish Guards doffed their bearskin hats to lead three cheers for the queen, the 86-year-old monarch beamed.
In a rare televised statement, the queen said the jubilee celebrations had been "a humbling experience."
"I will continue to treasure and draw inspiration from the countless kindnesses shown to me in this country and throughout the Commonwealth," the monarch said in the two-minute broadcast, shown in Britain and the 54-nation Commonwealth of its former colonies.
The Jubilee affirmed the nation's unmatched skills for staging impressive ceremonies, evoking the power and swagger of its vanished empire. The celebrations demonstrated as well the misery which some Britons will endure even sleeping outside in a cold rain in pursuit of a good time.
Philip's absence caused some hasty rearrangement of preparations but seemed not to dampen the high spirits. Prince Edward, who made a brief visit to the hospital, reported that his father was getting better and had been watching the celebrations on TV.
Asked about the queen, Edward said "she's bearing up but she's missing him, obviously."
Williams paid tribute to the queen for her service to the nation and Commonwealth. It was not a role she chose, but one thrust upon her when her uncle David, King Edward VIII, abdicated in 1936. The queen's father became king and Elizabeth, the elder daughter, was destined to reign.
Within the constraints of a constitutional monarchy, the queen's life has been one of ceremonial duty, world travel and the pleasures of great wealth. She has also been the mother of a family that has produced turbulent marriages and traumatic divorces.
"Dedication to the service of a community certainly involves that biblical sense of an absolute purge of selfish goals, but it is also the opening of a door into shared riches," Williams said.
"I don't think it's at all fanciful to say that, in all her public engagements, our queen has shown a quality of joy in the happiness of others; she has responded with just the generosity St. Paul speaks of in showing honor to countless local communities and individuals of every background and class and race," Williams said.
Attired in an outfit of fine silk tulle, embroidered with tiny mint green star-shaped flowers embellished with silver thread, the queen was a small, elegant figure, rarely smiling and often solemn as she followed the service.
As she left the cathedral, the queen paused near a tablet commemorating the Diamond Jubilee service of Queen Victoria in 1897.
Following the service, the queen went to the thousand-year-old Westminster Hall, the oldest part of the Parliament complex, to join 700 guests from the various Livery Companies the guilds which originated in the Middle Ages.
Prince William sat at the Worshipful Company of Engineers and Arbitrators table, while his wife, Kate, was placed with the Master Glovers and Pattenmakers. Prince Harry dined with the Fruiterers and Gardeners.
With most of Tuesday's events indoors or under cover, there was less worry about the precarious weather, which has ranged from unseasonably cool to downright foul, as rain poured during Sunday's grand procession of boats down the Thames.
President Barack Obama sent a video tribute extending "the heartfelt congratulations of the American people" to the queen. Obama hailed her as "a living witness to the power of our alliance, and a chief source of its resilience."
Twin sisters Margaret and Dorothy Roake were standing in the Mall more or less where they had been standing on coronation day in 1953 a year after she ascended to the throne. "The coronation was fabulous and this is really special, it makes you feel a reality in being British," Margaret Roake said.
Benedict Cleotes, 40, from the Philippines, said he came to the Mall at 4 a.m. to claim his spot. "Seeing the queen is very special to me and I want to have something to tell them in the Philippines. They will be jealous," he said.
Among the early arrivals at the cathedral were four women from Jedburgh, a Scottish town near the English border, who displayed a large Union Jack flag.
"We've been saving for three years to come here," said Marion Kingswood, 69. "Apart from the royal wedding, there's been nothing like it. Sixty years is such an achievement."
A few anti-monarchist demonstrators were outside the cathedral with slogans including "Republic Now!" or, in a shot at the cost of maintaining the monarchy, "9500 Nurses or 1 Queen?"
Royalists in the crowd responded noisily, chanting "God save the queen!"
Along the parade route, 70-year-old Margaret Barker said Philip's absence would put a damper on the queen's day.
"She's got the rest of her family around her but when you think of all the planning there's been for this and how long they've been together, it seems very sad that he can't be with her today," Barker said.
Tourist Cassandra Past, 20, from New York, said she expected the queen to keep her chin up despite worries about her 90-year-old husband. "She is the queen, and she sort of has to put on a good face for her country and her people," Past said.