'Cancer patients are often quite gung-ho," says John D Edwards at his studio in the Foundry, a converted biscuit factory in Poplar, east London, "but I could shut them up in seconds." Reliving his brush with death a decade ago, the celebrated painter tells how, in a bid to boost morale, patients on his cancer ward would gather to talk about their illnesses.

"There were awful cases – people with eyes missing, huge growths or bits chopped off," he recalls, "but none of them seemed fazed. Then I introduced myself. They said, 'so, what have you got?' 'Oh, er, men's cancer,' I replied. 'Prostate?' 'No.' 'Testicular?' 'No.' They dug a bit more until I just came out and said it. 'I've got penile cancer, OK – cancer of the penis!' You could have heard a pin drop."

It was one of many milestones in Edwards's long recovery from one of the rarest cancers, which the artist talks about with almost uncomfortable candour. Now all but clear of the disease that came very close to killing him, Edwards, 56, is showing some of the paintings he created throughout the ordeal in an exhibition now touring hospitals, starting at the Chelsea and Westminster in London.

Download the new Independent Premium app Sharing the full story, not just the headlines

Edwards has also produced a book. How Cancer Saved My Life, which includes a touching foreword by the painter's friend Sir Peter Blake, chronicles seven years of his life, starting before the diagnosis that changed everything. In the early 1990s, Edwards had returned to his beloved London flat at the Foundry, where moulds for sculptures by some of modern art's biggest names dot the corridors, after trying to "live like a rock star" in Gloucestershire. "When the postman is the most exciting person in your life you should worry," he says.

To celebrate his return to the capital, Edwards painted a series of playful visions of urban life, inspired by the cartoon annuals he loved as a child. The first painting shows a gurning bulldog in brilliant orange, its tongue hanging out. But, peering around the corner of a factory wall, the gnashing hound also appears to portend danger. "There was trouble in the neighbourhood," reads the caption.

It was in the bath that the artist discovered a lump in his groin. In a move that probably saved his life, he went straight to his GP. He was immediately referred to a consultant, who ordered a biopsy. "They told me I had a malignant tumour in my lymph nodes, that it was very serious, but that they didn't know where the cancer was coming from," Edwards says.

In a desperate hunt for the primary source of cancer, doctors at the Royal London Hospital, two miles from Edwards's studio, carried out a host of tests and biopsies. Soon, their search centred on Edward's penis. "They asked me if I had a foreskin, which I did," Edwards says. "Then they asked if I had ever had trouble pulling it back, which I had." Doctors circumcised Edwards and discovered a redness under his foreskin. This apparently innocuous rash was quickly identified as the source of his cancer.

Only 400 men a year in the UK are diagnosed with penile cancer, compared with 35,000 for prostate cancer. Placed way down the list of the most common male cancers at 23 (one place ahead of male breast cancer) it is extremely rare. It is also, says Edwards, very hard to talk about.

"I had always been quite squeamish and I was terrified at first," he says. "I told my family I had 'something' cancer. But it became so difficult not to talk about it so I just told them I had penis cancer, 'cancer of the dick!' With four sisters and a mother, you just have to say it like it is."

Reconciled to the nature of his cancer, Edwards then had to face treatment. Doctors started chemotherapy and prescribed him interferon, a stronger version of the anti-viral proteins already produced by the body. "The first day I injected it, all my nails fell off," he says. "It made me feel horrible."

Stuck in a hospital bed, it was one of the lowest periods for Edwards. When he could return to his studio, there was only one thing he could do. "I had to paint what I was experiencing – that's what I do," he says. But there would be no more childish cartoons. Perhaps the darkest depiction of his illness appears on the cover of his book. Out of this World shows Edwards as a bird, in bed, on the moon. "That's exactly how I felt," he says, "like an alien, completely cut off from the world, looking down at the life I might or might not go back to."

By this stage, Edwards's cancer was turning the artist into something of a medical celebrity. "A visiting consultant from France came in and asked, 'you're penile cancer man – can I have a look?' I said yes, and showed him my penis – it feels like I've showed it to the whole world. He had a look and said, almost in passing, 'In France, we would try radiotherapy with that.'" The snatched exchange would prove crucial.

Three months on, relentless chemotherapy and doses of interferon had turned Edwards, whose frame reaches well over six foot, into a grey-haired shadow. But worse was to come. "One day there was an explosion in my groin," he recalls. "This horrible Vesuvius – like a giant boil." Edwards was whisked straight to A&E.

The eruption turned out to be cancerous and marked a potentially terminal decline in Edwards's health. It was then that doctors confronted him with the worst decision a man could face. "They asked for permission to amputate my penis," Edwards says.

Demoralised, exhausted and full of drugs, Edwards gave his answer. "No, I told them. I just could not face another operation." Edwards started arguing with the consultant, whom he later nicknamed Slasher. "I told him unless you can say for certain this will save me, I'd rather die with my penis on, thank you very much."

Slasher appears in one of Edwards's paintings as a hawkish bird whispering his intentions to a colleague while concealing a terrifying, toothy saw behind his back. But, thanks to the French consultant who had visited Edwards earlier, the artist's penis would escape the chop. "I said I'd heard that radiation could work, and pleaded with them to try it instead."

Slasher relented and called off the penectomy, but the ordeal continued. First, Edwards had to be fitted with a mould for the radiation unit that would zap the cancerous cells in his penis. He remembers the day with characteristic good humour: "I couldn't believe there was a mould maker for penises in London. I went in there and he had these enormous moulds on a shelf. I looked at the man and said, what's this – are these for people or for London Zoo?"

Radiotherapy, while painless in itself, targets high-energy X-rays, and other rays, at the source of cancer. The side-effects can be horrific. Edwards's penis all but disintegrated before the skin could renew itself. "It was the most painful experience of my life," he says. But not all the effects were unpleasant. "About six months later, some American collectors of mine invited me to recuperate by their pool. Every time a mosquito landed on me, the radiation still inside me would kill it. It became my party trick."

The radiation had an equally lethal effect on Edwards's cancer. The artist slowly regained his strength and the colour returned to his paintings, in which sunrises and angels replaced dark skies and the Slasher. Indeed, Edwards credits his art with helping him to defy the odds. "I'd come back here and see these paintings on the wall and think, blimey, it can't be that bad," he says. "The ability to externalise was very important."

But most important, Edwards says, was laughter. "Cancer doesn't like humour," he says. "You have to decide whether to panic and fight it – I would see people come in like they'd run a marathon, who then couldn't cope with setbacks – or to live with it. I chose to live with it and if living included death, I would do that."

Edwards describes his experience as like "hearing a burglar downstairs – you know there's something unfriendly there, but you have time to decide what to do about it." Unsurprisingly, the artist's paintings, book, as well as the talks he gives at hospitals, have proved inspirational. "I got a message from a priest in Maidenhead who called my book a holy book of healing, which is all right by me," he says.

Edwards wants his experience to serve as a warning to other men not to ignore the warning signs. "I was amazed how many men had put up with so much before they went to the doctor," he says. "I'd talk to people who had been bleeding when they went to the loo for two years before they did anything about it."

So, how is the part of him that Edwards came so close to losing? "It works fine," he says, gleefully. "In fact, I was having an active love life throughout the experience, except for during the radiotherapy. I thought it was a bit like a footpath – if you don't use it you lose the rights to it."

For exhibition dates or to buy John's book, visit www.howcancersavedmylife.co.uk

Penile cancer: the facts

*There are around 400 cases of penile cancer every year in the United Kingdom. By contrast, there are some 35,000 cases of prostate cancer in the UK each year.

*One of the rarest of cancers, it accounts for an average of 100 deaths a year, equivalent 0.07 per cent of the total for all cancers.

*Some 86 per cent of cases occur in men aged 50 and over.

*Potential causes include smoking, a weakened immune system and poor hygiene.

Source: Cancer Research