Two scientists who discovered how to harness the body’s immune system to fight cancer have won the 2018 Nobel prize in physiology or medicine.

James Allison, of the US, and Tasuku Honjo, of Japan, will share the 9m Swedish kronor (£775,000) prize, announced by the Nobel assembly at the Karolinska Institute in Stockholm.

The scientists’ groundbreaking work on the immune system has paved the way for a new class of cancer drugs that are already dramatically changing outcomes for patients. It is the first time the development of a cancer therapy has been recognised with a Nobel prize.

Allison said he was in a “state of shock” about having achieved “every scientist’s dream”.

“I’d like to give a shout out to all the [cancer] patients out there to let them know we’re making progress here,” he said.

Honjo, who began his research after a medical school classmate died from stomach cancer, said: “I want to continue my research … so that this immune therapy will save more cancer patients than ever.”

The immune system normally seeks out and destroys mutated cells, but cancer finds sophisticated ways to hide from immune attacks. One way is by ramping up braking mechanisms designed to prevent immune cells from attacking normal tissue. In the 1990s, Allison discovered the first of these built-in brakes, known as checkpoints. Other teams were investigating the potential of enhancing the action of checkpoints to treat autoimmune diseases, but Allison showed that doing the reverse – switching off the brakes – could produce remarkable results in treating mice with cancer.

“I’m a basic scientist. I didn’t get into these studies to cure cancer, I wanted to understand how T cells work,” said Allison. However, he added that a family history of cancer (his mother died of lymphoma when he was 10) and having witnessed the ravages of radiotherapy and chemotherapy meant he always had an eye on whether his work might lead to a new therapy. “It was always in the back of my mind,” he said.

Independently, in 1992, Honjo discovered a second checkpoint that worked through a different mechanism and treatments based on this work have produced dramatic improvements to patient outcomes in the clinic.

The idea of mobilising the immune system to tackle cancer was first proposed more than a century ago, but it was only after the discoveries of Allison and Honjo that this tantalising possibility could be turned into a clinical treatment.

The resultant drugs, known as checkpoint inhibitors, have significant side effects, but have been shown to produce remarkable results in treating lung cancer, renal cancer, lymphoma and melanoma.

Honjo, an avid golfer, said he was once approached at a golf club by a fellow player, who thanked him for the discovery that treated his lung cancer. “He told me, ‘Thanks to you I can play golf again’,” Honjo said. “That was a blissful moment. A comment like that makes me happier than any prize.”

The Nobel assembly’s summary said Allison, who is professor and chair of immunology at the University of Texas’s MD Anderson Cancer Center, “studied a known protein that functions as a brake on the immune system. He realised the potential of releasing the brake and thereby unleashing our immune cells to attack tumours. He then developed this concept into a new approach for treating patients.

“Meanwhile Honjo, a professor of immunology at Kyoto University, discovered a different protein on immune cells that also appeared to operate as a brake, but with a different mechanism of action.”

A large number of checkpoint therapy trials are currently under way against most types of cancer.

Prof Charlie Swanton, Cancer Research UK’s chief clinician and a senior scientist at the Francis Crick Institute in London, said the discoveries had been transformational for understanding the potential of the human immune system to control or even eradicate tumours and blood cancers. “A decade ago, metastatic melanoma was largely incurable,” he said. “Thanks to work from Allison and Honjo, patients now have real hope, with over a third of patients deriving long-term benefit and even cures from such therapies.”

Allison’s former colleague, Prof Sergio Quezada of University College London, watched the Nobel prize announcement along with other former labmates at a cancer conference in New York. “The work that Jim and Honjo did was so seminal that people had been waiting for a few years for it [to win a Nobel],” he said.

Quezada describes his former boss, who is in a blues band called The Checkmates, as “an awesome guy, humble, a fantastic mentor … and an insane harmonica player”.

Prof Dan Davis, of the University of Manchester and author of The Beautiful Cure, a book that describes the work that led to today’s prize, said: “I’m so thrilled that a Nobel has been awarded for this game-changing cancer therapy. It doesn’t work for everyone but lives have been saved, and it has sparked a revolution in thinking about the many other ways in which the immune system can be harnessed or unleashed to fight cancer and other illnesses. I think this is just the tip of the iceberg – many more medicines like this are on the horizon.”

The Nobel prize in physics will be announced on Tuesday, followed by chemistry on Wednesday, peace on Friday and economics on Monday. The literature prize has been cancelled this year following allegations of sexual misconduct.