Salomon Brothers, one of the world's biggest and most prestigious investment firms, was purchased today in an $800 million transaction by Philbro Corp., the world's largest publicly owned commodity trading firm.

This was the fourth time this year that a large corporation outside Wall Street has acquired a major New York investment firm. Prudential Insurance, the nation's largest insurance company, purchased Bache, and American Express, the giant credit card company, bought Shearson Loeb Rhoades.

In a similar move, the Bechtel Group, a major international construction firm, purchased controlling interest of the old-line investment banking firm of Dillon Read & Co.

Despite these earlier acquisitions, Wall Street observers were surprised today that the tightly knit Salomon Brothers agreed to be purchased.

The investment firm long has had a reputation as Wall Street's biggest risk-taker and a haven for mavericks and colorful personalities. On an average day the big securities company, fourth largest in the United States, buys and sells about $7 billion in stocks, bonds and government securities.

Phibro is the larger survivor of the split-up of Engelhard Minerals & Chemicals Corp. in June. Once known as Philipp Brothers, the commodities firm will regain that name as one of two autonomous companies under the Phibro umbrella. [Details on Page D6]

Over the years, Salomon Brothers has attracted such diverse figures as former partner William Simon, the staunchly conservative Treasury Secretary under Presidents Nixon and Ford, and John Gutfreund, the firm's managing partner and one of a handful of liberal Democrats in the normally conservative upper echelon of Wall Street executives.

Henry Kaufman, one of the firm's major partners, probably is the most carefully followed economist on Wall Street. A pessimistic word from Kaufman, which is about the only kind he's delivered in recent years, can drive down the stock market or deal a death blow to corporate and private bonds.

Founded in 1910 by the three Salomon brothers with just $5,000 in cash among them, Salomon Brothers today has $250 million in net worth spread among its 62 partners.

The securities firm is also one of the leading investment bankers in the country, serving as an intermediary between companies that raise funds by issuing stocks or bonds and the investors that buy those securities. International Business Machines and International Paper Co. are among blue-chip clients Salomon has added in recent years.

A Salomon Brothers spokesman said that the mesh between Phibro and Salomon is a good one. "Both of us are risk takers. Salomon in trading securities, Phibro in trading commodities. We wouldn't have done this if it were an insurance company or a bank," he said.

Phibro made the approach to Salomon about a month ago, officials said, weeks after it split from Engelhard's manufacturing and minerals-processing segements. Salomon Brothers had been Engelhard's investment banker. "We knew each other well," a Salomon executive said.

During the first half of 1981, Phibro had revenues of $12.65 billion and profits of $128.8 million. The privately held Salomon is unusually tight-lipped about its finances, but said it had record operating profits in the 10 months ended July 31.

Unlike other major Wall Street firms, Salomon Brothers remained a partnership while other companies such as Merrill Lynch, Shearson and Bache converted to publicly owned companies that could raise new funds by selling stock to the public.

Just two months ago Gutfreund acknowledged that the partnership organization was an "anachronism" but said Salomon preferred it that way.

After Oct. 1, when Phibro and Salomon are supposed to close the deal, there will be no more partners in Salomon Brothers. Each of the former partners will be paid not only his share of the firm's $250 million net worth by Phibro, but will also get the same amount of a $250 million, 9 percent bond to be issued by Phibro. Those bonds (called debentures) can be converted into 9 million shares of Phibro stock. Each partner will double his net worth as a result of the deal.

There will be no mass exodus of top talent from the newly cash-rich Salomon partners. The partners have signed three-year contracts to stay on board, and members of the executive committee, including Gutfreund and Kaufman, signed five-year pacts.