Both trials tested the drugs that help the immune system to recognize and fight cancer as an initial treatment for advanced lung cancer. They are already approved for patients whose disease had progressed following chemotherapy, but approval as a so called first-line therapy could greatly increase the number of patients taking them.

Opdivo had been considered the leader among the new class of medicines. It generated $840 million of sales in the second quarter, more than double those of Keytruda.

The view of the rival drugs began to change in August, with the surprise announcement by Bristol-Myers that Opdivo had failed to best older chemotherapies in the Phase III trial.

Details of the trial unveiled at the European Society for Medical Oncology meeting in Copenhagen only heightened those concerns. Patients on Opdivo went 4.2 months before their disease worsened versus 5.9 months for those on chemo, although the difference was not deemed statistically significant.

"This data represented a worst-case scenario for Opdivo," Sanford Bernstein analyst Tim Anderson said in a research note.

The Opdivo trial enrolled patients regardless of their tumor's level of PD-L1 expression, a protein targeted by the drug whose presence may help identify those most likely to benefit from treatment with the new medicines.

Meanwhile, researchers reported that Keytruda halved the risk of disease progression in previously untreated patients, and cut overall deaths by 40 percent compared to chemotherapy.

Patients in the Merck trial were only enrolled if they were shown to have high levels of PD-L1, a narrower segment of the lung cancer population than those in the Bristol-Myers study.

"Merck will completely 'own' the segment of first-line lung cancer patients who have high PD-L1 expression levels, and Bristol Myers will capture nothing really," Anderson said.

Doctors are allowed to prescribe medicines for not yet approved uses, but analysts said they expect current off-label prescribing of Opdivo in first-line lung cancer to dry up now.

In addition, competition in second-line lung cancer is soon expected to intensify with the anticipated approval of Roche's immunotherapy Tecentriq, which is now approved to treat bladder cancer. Both Keytruda and Tecentriq are given every three weeks, while Opdivo is administered every two weeks, which is seen as a convenience disadvantage.

"The nearly inexplicable failure of (Opdivo) at every level of PD-L1 expression ... puts Merck in the driver's seat in first-line lung cancer for at least the next 12-18 months," said Leerink Partners analyst Seamus Fernandez.

Calling the Keytruda data "stunning,” Fernandez said, "We fully expect Merck to retain a significant place at the table long term."

Bristol shares, which had already lost one quarter of their value since the initial trial data was disclosed in August, fell 10 percent $49.85, while Merck shares were up 1.7 percent at $63.84 after earlier rising more than 3 percent to a near 15-year high.

Opdivo is also approved for advanced melanoma, kidney cancer and a type of Hodgkin lymphoma, while Keytruda is also approved for advanced melanoma, plus head and neck cancer. But lung cancer is considered by far the biggest market for cancer drugs.

(Reporting by Ransdell Pierson and Bill Berkrot; Editing by Bernadette Baum and Cynthia Osterman)

By Ransdell Pierson and Bill Berkrot