NEW YORK (AP) — Onyx Pharmaceuticals Inc. said Monday it will buy cancer drug developer Proteolix Inc. in a deal that could be worth as much as $851 million.

Onyx shares advanced $2.20, or 8.2 percent, to $29.10 in premarket trading.

Onyx will pay $276 million upfront for the privately held South San Francisco company, and in the process it gains Proteolix's cancer drug candidate carfilzomib, which is being tested as a treatment for multiple myeloma, non-Hodgkin lymphoma, and solid tumors. Its drugs are designed to trigger cancer cell death with minimal damage to the rest of the patient's body.

Onyx, of South San Francisco, will pay another $40 million next year if carfilzomib reaches a development milestone, and will pay another $535 million if carfilzomib is approved in the U.S. and Europe. That includes a $170 million payment if the Food and Drug Administration decides to conduct a fast review of the drug.

The deal is expected to close in the fourth quarter, Onyx said.

Proteolix is conducting mid-stage clinical trials of carfilzomib as a standalone treatment for multiple myeloma, which is a cancer of the blood, and as a treatment for solid tumors. It is also running early-stage tests of carfilzomib as part of a combination therapy in addition to the lymphoma study.

The company is also testing an orally-dosed cancer drug, and is doing research on immunoselective compounds.