MONTE CARLO, Monaco (AP) _ Several thousand people crowded around the cathedral today where a tearful funeral was held for Princess Caroline's husband, Stefano Casiraghi, killed in a boat-racing accident.

The 33-year-old princess, wearing sunglasses, a heavy black-lace head- covering and black dress, wept occasionally during the 55-minute service.

Casiraghi, 30, an Italian businessman, was killed instantly Wednesday when his boat flipped while racing at high speed in the World Offshore Racing championships.

The somersault ejected co-pilot Patrice Innocenti, who was hospitalized with injuries. Casiraghi, defending the championship he won in 1989 in Atlantic City, N.J. remained strapped in the boat, which slammed him headfirst into the ocean.

''The brutality of his death adds to our pain,'' intoned Roman Catholic Archbishop of Monaco Joseph Sardou during the solemn ceremony. ''The sea, so calm today, holds dangers that must constantly be confronted.''

Caroline sat in the front row between her father, Prince Rainier, and brother, Prince Albert.

Princess Stephanie, Caroline's younger sister, wept throughout and had to exit the service for a short time. Albert left briefly to comfort her.

Caroline's three children from her seven-year marriage to Casiraghi were not present.

Sardou praised Casiraghi as ''an exemplary sportsman and businessman,'' but said, referring to Caroline: ''It was through his union with you, madame, that he found the greatest expression of his Christian faith.''

Pallbearers carried Casiraghi's mahogany coffin to the nearby Chapel of Peace for burial in a spot overlooking the stretch of Mediterranean where his boat flipped over.

The 115-year-old cathedral could hold just 1,600 of the several thousand mourners who began lining up early today to attend the ceremony. The rest remained outside.

Mourners allowed entrance included Danielle Mitterrand, wife of French president Francois Mitterrand, and a host of celebrities, businessmen and political figures from around Europe.

Thousands of large and small floral bouquets covered the cathedral steps in a myriad of bright colors and pastels, offerings from Monaco subjects, corporations and the principality's famous casinos.

Brightly colored shorts and T-shirts worn by tourists contrasted with the stark black worn by Monaco's citizens. Armed police kept a close watch on the crowd.

Casiraghi's accident marks the second time in eight years the royal family ruling this wealthy Riviera principality has suffered sudden, tragic death.

In September 1982, Princess Grace - former Hollywood star Grace Kelly - died of injuries suffered in a car accident. Princess Grace was Rainier's wife and the mother of Caroline, Albert and Stephanie.

Most of Monaco's small shops closed for an hour during the ceremony.

Sardou's eulogy drew tears from mourners, some of whom remebered Princess Grace's death.

''I was here for Grace's funeral and now I'm here to mourn young Stefano. There is a curse on the royal house,'' said one elderly Italian woman.

A white-uniformed, five-man honor guard wearing red-tasseled hats stood stiffly at attention during the ceremony. Sunlight steamed through the small stained-glass windows.

Caroline wept as she walked out holding her father's arm.

The princess decided to bury her husband at the simple chapel over the objection of her in-laws, who wanted him interred in Italy, French and Italian newspapers reported.

Casiraghi married Caroline in a civil ceremony in 1983.

He had been racing at world-class level since 1984 and had told friends he planned to quit after this season.