FRANKFURT, Nov 28 (Reuters) - Germany's Merck KGaA suffered a setback in the development of key cancer immunotherapy Bavencio, which failed to prolong lives in gastric cancer patients when compared with standard chemotherapy.

Bavencio, or avelumab, which Merck is jointly developing with Pfizer, did not meet the primary goal of prolonging overall survival in patients whose cancer had returned or spread despite two prior treatment rounds, the two companies said in a statement on Tuesday.

Bavencio this year won regulatory approvals against a rare and aggressive type of skin cancer and against bladder cancer. First trial results in lung cancer, its largest commercial opportunity, are not expected before next year.

The drug is a late entrant to a fast-growing class of drugs called PD-L1 or PD-1 inhibitors that help the immune system attack cancer by blocking a mechanism tumors use to evade detection.

But trial results have been mixed across the class, depending on the cancer type and treatment setting.

"We are confident that our broad clinical development program in both monotherapy and combinations across a range of cancers will continue to bring new potential treatment options to patients," Chris Boshoff, Pfizer's head of immuno-oncology said in the statement.

Despite the disappointment in the so-called JAVELIN Gastric 300 trial, the two companies will continue to explore Bavencio in the JAVELIN Gastric 100 trial in an earlier treatment setting. (Reporting by Ludwig Burger; Editing by Douglas Busvine and Jane Merriman)