Amgen Inc. has completed its tender offer to purchase all outstanding shares of Onyx Pharmaceuticals Inc. at $125 a share, or a total price of $9.7 billion.

By the time the offer expired at midnight Monday, nearly 57.7 million shares were tendered and not withdrawn, representing 78.5 percent of Onyx's outstanding shares. That satisfied the condition of the tender offer that a majority of the shares be offered.

Onyx shareholders who did not respond to the tender offer will retain the right to receive $125 a share in cash.

The Thousand Oaks pharmaceutical giant is buying Onyx, based in South San Francisco, for its drugs that treat blood, colon, liver and kidney cancers.

“Amgen’s acquisition of Onyx fits perfectly with our commitment to advancing medicines for cancer patients around the world,” said Amgen Chief Executive Robert Bradway, in a statement. “We look forward to working together with the talented staff at Onyx to make the most of our exciting oncology portfolio and pipeline.”

Shares of Amgen gained, $2.65, or 2.4 percent, to close at $114.58 on the Nasdaq.