A.H. Robins Co. agreed in principle yesterday to merge with another large pharmaceutical firm, signaling a possible breakthrough in the Richmond company's efforts to emerge from bankruptcy and pay off more than 300,000 victims of its Dalkon Shield intrauterine birth control device.

Robins' board of directors voted unanimously to sign a letter of intent to pursue a $2.6 billion merger proposal by Rorer Group Inc. of Fort Washington, Pa. The offer is $200 million more than a previous Rorer bid that was withdrawn in the spring after Rorer failed to reach agreement with Robins.

Although the merger faces potentially fatal obstacles, lawyers involved in the case said yesterday's development was extremely significant because it represented the first sign that the Robins family of Richmond is ready to relinquish control of the 121-year-old pharmaceutical firm. The family, which owns 42 percent of the company's stock, would receive roughly $300 million in cash if the deal is consummated.

The merger would create a company with annual sales of roughly $1.5 billion that would rank sixth in the United States over-the-counter pharmaceutical market, the two companies said. Robins' major brands include its Robitussin cough medicine and Dimetapp cold and allergy tablets; Rorer is known for its antacid Maalox and Ascriptin, an analgesic.

Officials on both sides said that while it is too early to tell how Robins' 6,000 employes would be affected by the merger, they anticipated that the new company would retain a presence in Richmond.

The letter of intent followed several days of intensive negotiations by the two sides in a Richmond hotel, concluding at 1 a.m. yesterday morning, officials said. The deal is subject to execution of a definitive merger agreement by July 31, review by federal antitrust regulators and, most critically, approval by the federal bankruptcy court in Richmond.

"Unfortunately, this deal is not the end of this case," said Murray Drabkin, the chief lawyer for the Dalkon Shield victims. "However, it may change its direction."

The main roadblock continues to be the amount of money set aside to pay women who claim they were rendered infertile or suffered other injury by the Dalkon Shield, lawyers said. According to the letter of intent signed yesterday, two trust funds worth $1.75 billion collectively would be set up by the new company to pay claims, a sum equal to a previous Robins proposal.

Robins executives contend that this would be more than enough to pay claims, while plaintiff lawyers contend there are no guarantees the sum would be adequate. However, even if the Rorer merger fell through over this or other issues, yesterday's announcement could pave the way to further, more lucrative offers, lawyers said. The company has already turned aside several other offers, including the earlier Rorer proposal.

Robins filed for bankruptcy law protection in August 1985, and it has been seeking since then to negotiate a way of paying off victims and emerging as an independent, viable company. Under the federal bankruptcy code, a company is permitted to continue operations while it negotiates a plan of reorganization.

In April, the company filed its own plan of reorganization, calling for the establishment of the $1.75 billion trust fund for victims, to be financed primarily by borrowing from a consortium of banks. The company proposed staying independent.

This position, however, suddenly changed yesterday, apparently in response to pressure from company shareholders other than the Robins family. Stock speculators have purchased big blocks of Robins stock in the past several months, sharply driving up the price of Robins stock on the expectation that it was a ripe takeover candidate. In fact, Robins stock was the New York Stock Exchange's biggest gainer in the first six months of 1987, rising from a low in the $7 range to its current trading in the $28-per-share range.

Lawyers in the case said Robins' board would face potential shareholder lawsuits if they turned down this latest offer, which was communicated to the company last week.

A Rorer official said the company is offering Robins shareholders Rorer stock worth roughly $730 million in exchange for their Robins shares. H. Arvid Johnson, Robins' general counsel, said yesterday that board members acted out of a "fiduciary responsibility to its stockholders" in agreeing to pursue a merger. "Their offer was substantial, and they had to consider that," he said.

The Rorer offer is worth at least $30 per share for Robins shareholders, under the terms of the letter of intent. Richmond lawyer Stanley K. Joynes, who represents future Dalkon Shield plaintiffs, termed the offer "an incredible deal" for Robins shareholders.

The problem with the proposal, Joynes added, is that while Robins shareholders would reap a financial windfall, the trust fund might not be adequate to satisfy all current and future claims. He and Drabkin said the proposal would thus violate federal bankruptcy law, which requires that creditors and claimants be paid in full before shareholders get paid.

"Increasing the amount which will be paid to the Robins family and to the shareholders is just another demonstration of Robins' indifference to the claims of its 300,000 victims," Drabkin said.

"I'm getting a little tired of people saying that {$1.75 billion} isn't enough," Johnson responded, when asked about these criticisms. "All our experts say the claims are worth less."

Under the letter of intent signed yesterday, shareholders of Robins stock would receive either one share of a new series of Rorer convertible preferred stock with a stated value of $30, or 0.625 shares of Rorer common stock if the market value of Rorer common stock is more than $48 at the time of closing.

Robins stock closed Thursday at $28.75, up $1.25. Rorer gained $1.75 to close at $46.12 1/2.

Staff Writer Donald P. Baker contributed to this story.