The Food and Drug Administration on Thursday approved the first of an eagerly awaited new class of cancer drugs that unleashes the body’s immune system to fight tumors.

The drug, which Merck will sell under the name Keytruda, was approved for patients with advanced melanoma who have exhausted other therapies.

Cancer researchers have been almost giddy in the last couple of years about the potential of drugs like Keytruda, which seem to solve a century-old mystery of how cancerous cells manage to evade the body’s immune system.

The answer is that tumors activate brakes on the immune system, preventing it from attacking them. Keytruda is the first drug approved that inhibits the action of one of those brakes, a protein known as PD-1, or programmed death receptor 1.