Doug Ford, the pugnacious sidekick to Toronto Mayor Rob Ford, is stepping in to fill his ailing brother's place in the race to be the city's new leader, a last-minute switch that puts in motion a back-up plan that has long been contemplated, sources with ties to the mayor's office say.

The breathtaking turn of events – played out in the cramped quarters of City Hall's election office as cameras rolled – is the latest chapter in the political saga of Mr. Ford's troubled tenure that has captured international attention. The change means the end of Rob Ford's bid for re-election and keeps alive the prospect of a Ford-family comeback just six weeks before voting day.

Doug Ford, 49, officially signed his registration papers Friday afternoon, just minutes before the deadline for candidates to register. The elder Ford's move came shortly after Rob Ford – who is in hospital undergoing tests on an abdominal tumour – withdrew his candidacy. He registered instead to run for councillor in his former Etobicoke ward. His nephew Michael Ford, who was running for that seat, withdrew and is now running for school trustee.

Story continues below advertisement

"I've asked Doug to finish what we started together, so that all we've accomplished isn't washed away," Rob Ford said in a statement.

An emotional Doug Ford appeared Friday night flanked by his family outside the Etobicoke home where the brothers grew up. "He told me that he needed me to take the torch while he focuses on getting better," he said, as his mother Diane Ford cried and several dozen neighbours and supporters cheered him on.

The rookie councillor said he is not yet in "full campaign mode," and will speak about the race next week, adding he and the mayor share the "same values."

The idea of Doug Ford stepping in to take his brother's place has been in the air for some time and those who were once close to the mayor's office say it was floated more than a year ago when the mayor's trouble with substance abuse began to take its toll, even before a video surfaced that appeared to show him smoking crack cocaine.

Story continues below advertisement

But in the end, the change came down to the wire, with Councillor Peter Leon racing to the mayor's hospital room to witness paperwork less than an hour before Friday's 2 p.m. deadline to add and take names off the Oct. 27 ballot.

Doug Ford said his brother was running for mayor until about 24 hours before the switch came about. On Wednesday morning, the brothers were out for breakfast when the mayor complained of sharp pain in his abdomen.

"It was never in the works," he said, after describing how he talked it over with his wife and the mayor. "Unfortunately, things change rapidly in life, and it's taken a little turn on us."

Once the decision was made, there were some tense moments, especially when incomplete paperwork sent Mr. Leon to the hospital, where he waited for a slow-moving elevator with the mayor's chief of staff and lawyers. "We just made it here in time," said Mr. Leon, who was first approached by the mayor's staff to sign papers for both brothers around 12:30.

Story continues below advertisement

Doug Ford, known for his vitriol, his love of a live television camera and his penchant for talking off-the-cuff, brings a new dynamic to the campaign for mayor.

His main rivals – Olivia Chow and John Tory – took different tacks responding to their new Ford opponent. Ms. Chow refused to comment on the race, while Mr. Tory, leading in the polls, was quick to take the gloves off.

Mr. Tory told reporters the Etobicoke councillor is "more of the same and maybe worse" than his brother, characterizing him as an "insult-machine that operates on a pretty regular basis."

The Ford switch-up comes as Ms. Chow is struggling to reboot her campaign after losing her front-runner status. On Friday morning, she and Mr. Tory faced each other in a debate for the first time, a pairing that allowed her to take on her rival on policy without being overshadowed by a Ford. Now that's over.

Story continues below advertisement

All these events have unfolded at head-spinning speed, even in the context of Toronto city hall where uncertainty and political intrigue are the order of the day. Just Tuesday night the mayor was taking part in a debate, but Wednesday his health took a turn for the worse when severe abdominal pain prompted him to visit Humber River Regional Hospital. A CT scan revealed he had a mass in the lower-left quadrant of his torso.

On Thursday, he was transferred to Mount Sinai hospital where doctors performed a biopsy, the results of which would take a week to come back, according to Zane Cohen, the colorectal surgeon in charge of his care.

Although Dr. Cohen's specialty is colorectal surgery, he would not confirm the location of the tumour. Mr. Ford's father died of colon cancer in 2006.

In a biopsy, a sample of the tumour tissue is removed from the patient's body and sent to a pathology lab for analysis. The sample has to be processed overnight and set in a wax-like block so that it can be sliced thinly for viewing under a microscope.

"In a case like Mr. Ford's, sort of an urgent type case … every effort would be made to have that slide looked at the very next day," said Victor Tron, the chief of laboratory medicine at St. Michael's Hospital in Toronto. (Dr. Tron is not involved in Mr. Ford's care and could only speak about the pathology process in general.) Still, further testing on the sample could be necessary, depending on the type of tumour and whether it is benign or cancerous.

Story continues below advertisement

There was no additional news of the mayor's health Friday, but in his statement he said his medical condition is too severe to continue in the gruelling campaign for mayor. "Now I could be facing a battle of my lifetime," he said. "With the advice of my family and doctors I know I need to focus on getting better … My heart is heavy when I tell you that I'm unable to continue my campaign for re-election as your mayor."

Mr. Leon, who happened to be in his City Hall office when the mayor's staff needed a witness, said the mayor was walking when he saw him at the hospital.

"The mayor is just getting himself better, " Mr. Leon said, his eyes welling up. "This is very emotional. This is part of history folks," he said.

With files from Patrick White and Kelly Grant