A head-on car crash today killed three Secret Service agents assigned to protect Queen Elizabeth II as the royal party headed into the snowy Sierra for the weekend.

The accident occurred as the queen and Prince Philip went to Yosemite National Park to relax after hosting a wedding anniversary dinner that turned into an intimate late-night champagne party for President and Mrs. Reagan on the royal yacht in San Francisco Bay.

The dead agents were identified as George P. La Barge, 41, of Dayton, Ohio, Donald W. Robinson, 38, of Newark, N.J., and Donald A. Bejcek, 29, of Chicago. La Barge was previously assigned to Washington from 1973 to 1981, and served in the vice presidential protective division during his first four years here, according to the Secret Service.

The accident did not involve the royal motorcade, which passed through the area about 30 minutes later, the California Highway Patrol reported.

The crash occurred at 10:50 a.m. PST about 120 miles east of San Francisco and about 25 miles west of the entrance to Yosemite. The agents "were en route from Castle Air Force Base to assume protective duties for the queen in Yosemite," Secret Service headquarters in Washington said.

Two sheriff's deputies also were injured in the accident.

A highway patrol spokesman said a Mariposa County sheriff's patrol car sideswiped a Secret Service car on state Highway 132 between La Grange and Coulterville, then continued down the road and hit another Secret Service car head on.

The highway patrol spokesman said it was believed the royal motorcade detoured around the crash site and the queen did not see the wreck.

Her press secretary, Michael Shea, said the queen "was very saddened" and upset by news of the accident.

In a statement released from Air Force One en route to Washington, Reagan extended his sympathy to the families of the three agents "who gave their lives today in the service of their country," describing the men as "professionals in every sense of the word."

About two hours after the accident, Elizabeth stopped at the 4,000-foot-high Inspiration Point, in the National Park, to look across a gray, misty valley of pine trees to the 7,569-foot sheer rock face of El Capitan mountain.

She looked grim-faced and spoke only briefly to two waiting National Park rangers before she and Philip climbed back into their bullet-proof car and headed on.

Elizabeth's personal doctor, Prof. Norman Blacklock, who was traveling in the royal convoy, offered his assistance when informed of the accident, but local officials said they had things in hand.

Elizabeth and Philip arrived later at the Ahwanee Hotel, where they have taken all 120 rooms for the weekend and park rangers were keeping spectators at a distance.