Advanced melanoma patients will have access to another drug from September.
After months of campaigning including a petition by supporters of Keytruda, Pharmac announced on Tuesday that it would fund the drug.
Pharmac has funded rival drug Opdivo since July based on more certain survival data.
Last year Pharmac raised concerns about the long term risks and benefits of the drug versus the high cost, but says clinical evidence had evolved.
"Since we first received the funding application for pembrolizumab, new information has emerged that has given Pharmac the confidence we needed to progress the funding decision," operations director Sarah Fitt said.
Keytruda is designed to treat melanoma which cannot be removed by surgery alone, or where the cancer has spread, according to manufacturer MSD.
"Immunotherapy medicines are changing the face of cancer treatment worldwide and offer the biggest advancement since chemotherapy," MSD New Zealand director Paul Smith said.
MSD currently has 14 oncology trials underway around New Zealand and Mr Smith said he expects new patients to be registered for the cancer therapy from next year.