Amy Robach, an anchor on ABC’s “Good Morning America,” had avoided her doctor’s recommendation for a mammogram screening for a year, when a producer for the show called at the end of September and asked her to consider undergoing a televised mammogram.

Reluctantly, she agreed. “You know what, Amy,” her colleague Robin Roberts, a breast cancer survivor, told her, “if one life is saved because of early detection, it’s all worth it.”

On Oct. 1, as all the major television networks promoted the beginning of Breast Cancer Awareness Month, Ms. Robach submitted to the screening live on the show. A television camera discreetly showed the procedure. Normally, these morning-show segments end there. But unbeknown to viewers, the mammogram turned up evidence of cancer. On Monday Ms. Robach announced on “Good Morning America” that she would undergo a double mastectomy later this week.

“While everyone who gets cancer is clearly unlucky, I got lucky by catching it early, and there are so many people to thank for making sure I did,” Ms. Robach, 40, wrote in an ABC blog post that accompanied her announcement. “Every producer, every person who urged me to do this, changed my trajectory. The doctors told me bluntly, ‘That mammogram just saved your life.’ ”

Ms. Robach’s breast cancer diagnosis means that once again “Good Morning America” will be affected by the personal health battle of one of its stars. Last year Ms. Roberts, whose bout with breast cancer came in 2007, was diagnosed with myelodysplastic syndromes, a rare disease that required her to undergo a bone-marrow transplant. Ms. Roberts was away from the show for about six months while she recuperated.

On Oct. 1 Ms. Roberts led a conversation about breast cancer awareness while Ms. Robach was screened. In a taped interview, Ms. Robach said her first instinct when the producer called about the possible screening was to say, “No way, never gonna do it.”

She added, “I’m 40 years old. I’ve never had a mammogram. I’ve avoided it. And I started thinking, ‘Wow, if I’ve put it off, how many other people have put it off as well?’ ” She said the encouragement of Ms. Roberts was crucial.

Afterward, to encourage viewers to be screened, Ms. Robach said, “It hurt so much less than I thought it was going to hurt.”

Ms. Robach, formerly of NBC News, joined ABC last year as a correspondent and anchor. She is unofficially one of the two main substitutes on “Good Morning America,” filling in when co-hosts like Robin Roberts or Josh Elliott are away.

Ms. Robach appeared shaken up as she told viewers about her diagnosis on Monday. An ABC spokesman said she would take a leave of absence.

The other main substitute on the show, Elizabeth Vargas, is also away. She announced last week that she was seeking treatment for alcohol addiction. She last appeared on “Good Morning America” on Oct. 18.

“Like so many people, I am dealing with addiction,” she said in a statement to The Daily News of New York after the newspaper learned that she was at a rehabilitation facility. “I realized I was becoming increasingly dependent on alcohol. I am in treatment and am so thankful for the love and support of my family, friends and colleagues at ABC News.”

A version of this article appears in print on , Section B, Page 1 of the New York edition with the headline: ABC Anchor’s On-Air Test Found Breast Cancer. Order Reprints | Today’s Paper | Subscribe