Prince Rainier, his face puffy with grief, his cheeks wet with tears, bade farewell to his wife, Princess Grace, today at an emotional funeral in the cathedral of their tiny realm on the Riviera.

For all the glamor of her public life and despite the live television coverage of this final page of the Grace Kelly story, the funeral seemed an intensely personal affair for Rainier and two of his children, Albert and Caroline. Rainier made no attempt at dignified composure, instead letting the world see the extent of his sorrow.

Just after 10 a.m. (4 a.m. EDT) on a sun-dappled morning, Rainier, with his children at his side, led a cortege from the family palace along the narrow Rue Bellando de Castro, followed by pallbearers drawn from the order of Black Penitents. Only citizens and residents of Monaco were permitted to watch as the procession made its way the few hundred yards to the cathedral.

While his 24-year-old son Albert walked composed and erect, and his 26-year-old daughter Caroline dabbed at misty eyes, Rainier, looking a decade older than his 59 years, had to be gently assisted along the way.

Princess Grace died Tuesday, at 52, after suffering a stroke while driving near Monte Carlo and tumbling down a ravine in her Rover 3500. Her 17-year-old daughter Stephanie was with her and remains in the hospital suffering from a cracked vertebra.

Misleading early reports, understating Princess Grace's injuries as well as other rumors about the circumstances of the accident, had given events here this week an overheated quality of suspected scandal. But police, doctors and the media now appear to be satisfied that the confusion arose largely from the shock of what happened and that nothing of importance remains to be uncovered about the incident.

So with speculation finally put to rest, what remained for the funeral today was merely the tragedy of an untimely passing, the memory of a famous movie star and a gracious princess.

The 75-minute service was shorter than it might have been, apparently on Prince Rainier's orders. He was also said to have resisted the requests for live television and gave in only when strict limitations were put on the placement of cameras and lights.

About 400 persons attended the funeral, including President Reagan's wife, Nancy, Britain's Princess Diana of Wales, French President Francois Mitterrand's wife, Danielle, French Foreign Minister Claude Cheysson, a selection of other European royalty, a small contingent from Hollywood and representatives of Monaco.

Reagan, wearing a broad-brimmed black hat, at several points wiped tears from her eyes. She and Princess Diana, wearing a black straw hat with a small veil, sat directly behind Rainier and his children. Reagan arrived late last night, stayed in the Grimaldi palace, the Rainier family home, and left for Washington this afternoon following a short reception.

Rainier decided earlier this week that the funeral was not to be a formal state occasion, which explains the relatively small number of international notables who attended.

Several hours after the funeral, the cathedral was opened again for a mass restricted to citizens of Monaco. Prince Rainier also attended the second mass. Princess Grace was buried later in a royal crypt behind the main altar.

Throughout the day the cathedral bells pealed.

Monte Carlo itself came to a halt. Casinos were shut and stores remained closed. Careful management of the funeral arrangements by the prince's staff as well as strict police enforcement of crowd control and the press succeeded in curbing the gaudy atmosphere that prevailed around the city Friday.

The ceremony was led by Archbishop Charles Brandt, the archbishop of Monaco, assisted by an ecumenical group of clergy from Protestant and Orthodox churches, along with a special envoy from Pope John Paul II and Archbishop Giles Barthe, now the archbishop of Frejus Toulon who married Princess Grace and Rainier in 1956.

In his eulogy, Brandt praised the princess, saying: "Our princess was so helpful to others, now she receives the help of our prayers."

Much of the service consisted of music by Bach, Haydn, Gabriel Faure and Samuel Barber as well as Gregorian chants performed by the cathedral choir and Monaco's philharmonic orchestra.

Yet the ceremony was not especially lavish. A small contingent of the prince's guard, the Royal Carabinieri, provided a touch of military pageantry and a Rolls Royce limousine whisked Rainier and his children away after the funeral was over.

But as much as possible in a fairy-tale kingdom, a mecca for gamblers and sun worshipers nestled along the deep blue Mediterranean, this was a genuine family occasion.

The loss of Princess Grace deprives Monaco of a visible symbol of elegance and admirable human qualities. She was an active patron of the arts and a long list of charitable organizations to whom she lent time and provided publicity.

By any reckoning, Grace Kelly made the transition from American movie star to royal matron without a slip, and her 26 years here coincided with a period of unprecedented growth in Monaco's tourist and commercial economy.