In a ceremony steeped in tradition and symbolism, Prince William, the second in line to the British throne, married his longtime girlfriend, Kate Middleton, on Friday amid an outpouring of joy and patriotism here and before a potential worldwide audience of two billion people who tuned in on television and the Internet.

The couple exited historic Westminster Abbey as husband and wife shortly after noon, following a wedding service presided over by the Archbishop of Canterbury and executed with military precision, with Middleton's grand entrance, the singing of hymns and the exchange of vows planned down to the last minute.

Massive crowds cheered and waved as a royal coach took the newlyweds from the church to Buckingham Palace.

Hundreds of thousands of well-wishers, some of whom spent the night on the sidewalks to grab the best vantage points, lined the coach route and filled London's Hyde Park and Trafalgar Square to watch the wedding on giant screens. The Union Jack, Britain's flag, was in evidence everywhere, though many of the eager spectators were foreigners fascinated by Britain's ancient monarchy.

The marriage puts Middleton, a commoner according to the British class system, in line to become queen if her husband eventually ascends to the throne. Though invariably described here as "middle class," Middleton, 29, is the daughter of millionaire parents who made their fortune through a party-supply business.

For now, she is the Duchess of Cambridge, following Queen Elizabeth II's decision, announced Friday morning, to award the ancient but disused title of Duke of Cambridge to her grandson William. Formally, Middleton is not a princess.

The wedding was the biggest event on Britain's social calendar in years, but not a state occasion. Even so, the soaring Gothic interior of Westminster Abbey was jammed with nearly 2,000 guests, including more than 40 crowned heads, 200 government officials and diplomats, and 60 governors-general and prime ministers from countries belonging to the Commonwealth.

Also in attendance were celebrities such as singer Elton John, soccer player David Beckham and wife Victoria, and film director Guy Ritchie.

A massive security presence costing an estimated $33 million was deployed throughout London, consisting of 5,000 police officers -- including 900 just to keep order along the procession route -- and 35 sniffer dogs.

It was the grandest royal wedding this nation has seen in 30 years, since the marriage of William's father, Prince Charles, the heir to the throne, and mother, Lady Diana Spencer. That occasion, too, provided a chance for national celebration during a time of economic uncertainty and public austerity.

The memory of Diana was strong for many in the crowds Friday because of William's strong resemblance to his mother and the fact that her 1997 funeral, after her death in a car crash in Paris, was also held in Westminster Abbey.

The abbey's bells were pealing loudly when William, 28, arrived on the dot of 10:20 a.m., wearing the bright red uniform of the Irish Guards, a regiment of which he is honorary colonel. At his side was his younger brother and best man, Prince Harry, also in military uniform.

Middleton's arrival at the church, at 11 a.m. finally ended the fevered speculation over the designer of her wedding dress: Sarah Burton from the house of the late Alexander McQueen, who committed suicide last year.

The bride wore a translucent veil, apparently in spite of a tradition for a royal bride to leave her face uncovered in order to show she is not an impostor.

Some of the loudest cheers were reserved for the queen, who celebrated her 85th birthday last week and who has reigned for 59 years. A majority of Britons alive today have known no other sovereign, and polls consistently show her to be the monarchy's most respected figure.

(c) 2011, Los Angeles Times. Visit the Los Angeles Times on the Internet at http://www.latimes.com/. Distributed by McClatchy-Tribune Information Services.