Toronto mayor Rob Ford will undergo 40 days of chemotherapy to treat a rare and difficult-to-beat cancer that forced him to do what months of scandals over drug and alcohol abuse could not - drop his bid for re-election.

Toronto mayor Rob Ford will undergo 40 days of chemotherapy to treat a rare and difficult-to-beat cancer that forced him to do what months of scandals over drug and alcohol abuse could not - drop his bid for re-election.

Mr Ford, who has been in hospital for a week with a tumour in his abdomen, announced on Friday that he was pulling out of the October 27 race and his brother Doug would run in his place.

Dr Cohen said the cancer is spreading and that they have found "a small nodule in the buttock" near the left hip. He said the mayor will be treated with fairly intensive chemotherapeutic agents within the next two days.

He said Mr Ford had a CT scan in 2011 and there was no sign of the tumour then. "But we're treating this very aggressively in order to eradicate the tumour."

Mr Ford, 45, has been engulfed in controversy since the Toronto Star and the US website Gawker last year reported the existence of a video apparently showing the mayor inhaling from a crack pipe.

After months of denials, he finally admitted to using crack but adamantly refused to resign, even after Toronto's City Council stripped him of most of his powers. A stream of revelations of erratic behaviour, public drunkenness - and a report of another crack video - finally prompted him to enter rehab earlier this year. He returned to work and campaigning in June.

Doug Ford, a city councillor who has been his brother's most aggressive defender, is expected to face an uphill battle against two other major candidates in the mayoral election. He said the mayor is crushed.

"My brother has been diagnosed with cancer and I can't begin to share how devastating this has been for Rob and our family," Doug Ford said in a statement. "He is an incredible person, husband, father, brother and son and he remains upbeat and determined to fight this."

Rob Ford, who was elected mayor in 2010, is still running for his old city council seat representing a district in his home suburb of Etobicoke, where he gained a faithful following for his brash everyman style and conservative fiscal policies.

Dr Cohen said the mayor remains in pain but they are managing it.

"He may be able to work through it. I think that he will be able to be functional, but he's going to have some rough days," Dr Cohen said.

Dr Cohen said Mr Ford's cancer makes up only about 1% of all cancers but said he was optimistic about Mr Ford's treatment because they have many experts in sarcoma at the hospital. He said Mr Ford will get two cycles of chemotherapy over the next 40 days in an effort to shrink the tumour, and then they will assess. He said surgery may or may not be necessary.

"We are optimistic about treatment. This particular liposarcoma is more sensitive to chemotherapy than most sarcomas," Dr Cohen said.

Dr Cohen said the tumour is about 12 centimetres (5in) by 12 centimetres and is about two or three years old. It has not spread to organs, he said.

Liposarcoma is a type of soft tissue cancer that begins in fat cells, or fatty tissue, and occurs most often in older adults. A sarcoma is a soft-tissue cancer that can occur anywhere in the body and that is often encapsulated or contained within a pouch of tissue. Soft tissue includes muscles, tendons, fat and blood vessels, and treatment varies depending on the size, stage and location of the tumour, among other things.

Mr Ford's father, Doug Ford Sr, died in 2006 of colon cancer at the age of 73 three months after he was diagnosed with the disease.

Both of the two other major contenders in the mayoral race - moderate conservative John Tory and left-leaning Olivia Chow - wished Mr Ford well and called him a fighter.