Stock shot up 20 percent for San Diego’s Trius Therapeutics Inc. after it announced it was acquired by Lexington, Mass.-based Cubist Pharmaceuticals Inc.

The same did not hold for Optimer Pharmaceuticals Inc., which was also acquired, as its stock fell 6 percent following the announcement. Cubist Pharmaceuticals recently acquired the two San Diego antibiotics makers in a deal that could be worth up to $1.62 billion.

At market close on July 31, shares for Trius — a $675 million market cap company — traded at $14.10 a share, up $2.39 from the day before. Conversely, shares for Optimer closed at $12.51, a $0.78 cent drop for the $609 million market cap company from the day before the announcement.

Cubist stock rose 9 percent following the announcement, up $5.35 and closing at $52.35.

Cubist will pay approximately $707 million for Trius, but it could increase to $818 million over time for Trius shareholders. Cubist will pay $535 million for Optimer, a sum which could increase to $801 million.

Cubist said its prime interest in acquiring Optimer was for rights to its antidiarrheal drug, Dificid, which was approved by the U.S. Food and Drug Administration in 2011. The drug brought in $69 million in revenue in the past 12 months, and has been lauded for its impressive sales at launch.

Cubist said it targeted Trius because of its antibiotic called tedizolid phosphate which is still under development. The powerful drug can be administered orally or intravenously, and treats dangerous gram-positive infections like methicillin-resistant Staphylococus aureus (MRSA).

—Meghana Keshavan