Lord Louis Mountbatten, the elder statesman of Britain's royal family, was assassinated near his vacation home in Ireland across the border in Northern Ireland in apparently coordinated bombing attacks today by Irish Republican Army terrorists.

With at least 22 people dead altogether, it was the worst single day of killing since British troops were sent to Northern Ireland 10 years ago this month to quell sectarian violence there. Today's attacks by Catholic terrorists also raised fears about retaliation by long-dormant paramilitary Protestants in Ulster and questions about Irish-British cooperation in border security.

Officials also expressed concern about the safety of Pope John Paul II, who is scheduled to visit Ireland at the end of next month on his way to the United States. However, Irish Catholic officials said the pope's plans will not be changed.

Buckingham Palace officials said Queen Elizabeth was "deeply shocked" by the death of Mountbatten, her second cousin.

Lord Mountbatten, 79, a celebrated World War II commander and later the last viceroy of India, was killed by a massive explosion that blew apart his 29-foot yacht, Shadow V, just after noon today. The ship was leaving the picturesque harbor of Mullaghmore on Ireland's northwest coast, about 15 miles from the Northern Ireland border. Mountbatten's 14-year-old grandson, Nicholas Knatchbull, and 16=year-old Paul Maxwell, who was crewing the craft, were also killed by the blast.

Mountbatten's daughter, Lady Patricia Brabourne, her husband, film and television producer Lord Brabourne (John Ulick Knatchbull), his mother, the Dowager Lady Brabourne and his son, Timothy, who was Nicholas' twin brother, all were critically injured in the explosion. They are in the intenesive care unit of a hospital in nearby Sligo, Ireland.

The outlawed Provisional IRA issued a statement claiming responsibility for "the execution today of Lord Louis Mountbatten" and describing the bomb that blew up his yacht as 50 pounds of explosives detonated by remote control.

At the same time that statement was being made to news organizations in Ireland and Britain -- five hours after Mountbatten was slain -- two more massive explosions killed at least 18 British soldiers and one civilian and seriously injured at least eight other soldiers near the village of Warrenpoint in County Down, just across the border in British-ruled Ulster on the eastern coast of Northern Ireland.

The well-planned ambush used two big bombs, one in a truck loaded with hay and another minutes later in a nearby stone house. The first bomb caught a passing truckload of troops and the second hit the reinforcements sent in to rescue them.

There were also reports that the soldiers were fired on by gunmen with automatic rifles between the two blasts and that local residents, golfers from a nearby course and passing tourists were injured by the explosions and gunfire.

The Provisional IRA immediately took responsibility for the County Down killings, too, saying in a statement that the two bombs there were detonated by remote control "in similar fashion to the bomb which was set off to kill Lord Mountbatten."

Early this morning, as physicians in Sligo, Ireland, fought to save the lives of Mountbatten's relatives, the Army in Ulster carefully counted and interviewed its troops to determine amid the confusion at Warrenpoint the precise pattern of events there and an accurate number of dead.

Even if the toll does not rise further, today's deaths raise the number of British troops killed in Ulster during the last decade to 320 and the total number of troops, Ulster police and civilians killed to nearly 2,000.

Lord Mountbatten is the most prominent person murdered since senior Conservative member of Parliament Airey Neave was killed by a sophisticated car bomb as he drove up the ramp of the House of Commons underground garage at Westminister here on March 30. Britain's ambassador to the Netherlands was assassinated in The Hague in what is believed to have been an IRA terrorist shooting a week earlier. Britain's ambassador to Ireland was assassinated in Dublin in 1976 in the last terrorist killing of a British official on Irish soil.

Prime Minister Margaret Thatcher, who had earlier paid tribute to Mountbatten after receiving the news of his death, said tonight after the ambush of the soldiers and the IRA's statements that "by their actions today, the terrorists have added yet another infamous page to their catalog of atrocity and cowardice.

"If reports of their involvement in the death of Lord Mountbatten prove true, they will earn the condemnation and contempt of people of goodwill everywhere.

"By the same token, the senseless murder of members of the security forces has reinforced the repugnance felt for those who seek to advance their political ends by these evil means.

"The people of the United Kingdom will wage the war against terrorism with relentless determination until it is won."

In the United States, President Carter expressed his "profound" shock and sorrow at the "tragic and violent death" of Lord Mountbatten. "In peace and war, he was a leader of monumental ability," the president said in a statement.

Early this morning, Irish Prime Minister Jack Lynch said from Portugal, where he is vacationing, that Lord Mountbatten "was a man of great courage and was highly respected by the people of our country," He declared that "no effort would be spared" by Ireland "to bring these criminals to justice."

"The Provisional IRA are relentlessly and insidiously proving to be the real enemies of Ireland," Lynch said. "They bring shame to all Irish people at home and abroad who wish to see Ireland progress politically and economically in harmonious relationship with Britain."

Ireland's deputy prime minister, George Colley, said in a television interview in Dublin tonight that following Mountbatten's assassination "clearly it has entered many people's minds that this creates more problems in connection with the pope's visit, that will have to be considered carefully."

Irish government officials already were known to be worried about the pope's safety, particularly if he were to approach or cross the border into Northern Ireland. While tens of thousands of Ulster Catholics have signed a petition asking him to come there during his visit to Ireland, which is scheduled for Sept. 29 to Oct. 1, militant Protestant leaders in Ulster have threatened to mount huge protest demonstrations.

The chairman of the special committee of Irish Catholic leaders organizing the pope's visit, Bishop Francis McKiernan, said last night that "the explosion will arouse a particular revulsion at a time when people are preparing to welcome a man who stands for peace and the sacredness of human life."

In Rome, where he arrived yesterday to work on details of the pope's visit to Ireland, Cardinal Thomas O'Fiaich, Catholic primate of Ireland, whose own archdiocese of Armagh straddles the border with Ulster, said "The news from Ireland totally appalls and horrifies me.

"This is mass murder and nothing can justify it," said the cardinal, who has been a strong spokesman for the rights of Catholics in Northern Ireland. "These deeds bring disgrace to our country and give scandal to Christians everywhere."

May other members of Parliament reacted angrily and demanded that the Irish government take strong steps to help British security forces find and prosecute IRA terrorists who operate from inside Ireland, striking quickly across the border into areas such as County Down.

Although Ireland still will not extradite IRA suspects to Britain, it agreed earlier this year to use plain-clothes Irish police specialists to agressively patrol the border and search inside Ireland for known terrorists and their weapons.

This step was requested by Britain after security officials concluded that the IRA had come back from a long period of relative inactivity with a smaller but more professional force of terrorists with more sophisticated weaponry.

Details of today's ambush in County Down were still sketchy. It began when a truck carrying soldiers drove toward the Irish Republic.

As the Army truck passed a truck full of hay parked beside the road, what the IRA claimed to be a 1,200-pound bomb exploded, destroying the truck and killing at least eight soldiers. Debris blew across the border into Ireland.

About 25 minutes later, as more soldiers in an Army bus and a rescue helicopter arrived at the scene, the second bomb in which the IRA described as 500 pounds of explosives, blasted through an abandoned granite house 100 yards from the first explosion. It killed and wounded more soldiers and damaged the helicopter.

Hidden terrorists then reportedly opened fire on the soldiers from just across the border and some soldiers fired back. They hit and killed a man they thought was a terrorist but who was identified initially by Irish authorities as a British tourist on a fishing trip, one of many civilians who went to watch or help after the first bomb exploded.

The IRA denied last night that its men fired guns at the troops. Soldiers at the scene reported that there was 15-minute gun battle that kept ambulances from reaching the wounded. Army spokesmen said they were trying to determine exactly what happened.

The assassination of Lord Mountbatten five hours earlier also showed signs of sophisticated planning. This was the last weekend of a three-week trip to Classiebawn Castle near the fishing village of Mullaghmore, where he has spent part of the summer for the last three decades.

As usual, he left the two Irish policemen who guard him on the dock when he took the green-and-white boat out of the harbor.

Boaters in the harbor helped pull the badly maimed bodies and survivors out of the water. The least seriously injured was Lord Brabourne, the film producer who made "Sink the Bismark!", Romeo and Juliet," "Murder on the Orient Express" and "Death on the Nile." His mother, wife and surviving son all underwent surgery in efforts to save their lives.

Mountbatten's funeral, being planned by Buckingham Palace, will take place Sept. 5 or 6, at Westminster Cathedral. He will be buried at Romsey Abbey in Hampshire near the rural mansion he inherited from his wife, the former Edwina Ashley, who died in 1960.