Monsanto Co. and rival drugmaker Pharmacia & Upjohn Inc. agreed to merge in a $26.5 billion stock transaction and sell off part of the agriculture business that helped drag down Monsanto's stock price by 12 percent this year.

Monsanto stockholders will exchange each of their shares for a share of the combined company in the transaction, described as a merger of equals without a premium for shareholders. Pharmacia shareholders will receive 1.19 shares for each of their shares, a 1.1 percent discount, based on Friday prices.

Monsanto shares closed at $41.75 a share, up $1.37 1/2; Pharmacia shares closed at $50.37 1/2, down $2.62 1/2.

The transaction would create a company with drug sales of more than $9 billion a year, on a par with 11th-ranked Eli Lilly and Co., and a combined research and development budget of $2 billion a year, rivaling industry leader Pfizer Inc.'s $2.8 billion. The combined company plans to sell part of Monsanto's agriculture unit in an initial public offering.

The companies said they would have the third-largest sales force in the United States, an asset in marketing Monsanto's blockbuster arthritis drug Celebrex, which had $1 billion in sales its first 10 months on the market, as well as Pharmacia's glaucoma drug Xalatan and incontinence drug Detrol.

The combined company will have its corporate and pharmaceutical headquarters in Peapack, N.J., Pharmacia's home base.