On Sunday, ABC officially confirmed reports that the upcoming season of “Desperate Housewives” would be its last.

But series star Felicity Huffman got the bad news on Friday — in an e-mail from her co-star Marcia Cross.

Only after that did she get the call from “Housewives” creator Marc Cherry.

Huffman, who plays frustrated stay-at-home mom Lynette, said she shed a few tears at her kitchen table while consoled by her husband, actor William H. Macy.

Then, she said, their 9-year-old daughter entered the room and set her straight: “It’s OK, mama. You’ll work again.”

“Desperate Housewives,” a sassy prime-time soap opera with an ensemble cast also including Teri Hatcher and Eva Longoria, made a splash when it premiered in 2004 but has since seen a falloff in the ratings and viewer buzz.

At an ABC press party Sunday night, Huffman said she was sad that “Housewives” would be ending after eight seasons. But she’s also exhilarated by potential story lines in the show’s home stretch.

In her mind, the troubled but so-far-enduring marriage of Lynette and Tom (played by Doug Savant) might be on the rocks.

“I think they could get divorced,” Huffman proposed with undisguised relish. “All bets are off. I think it’s so great to bust the lid off.”

Asked how she plans to cope with relinquishing the role of Lynette, Huffman quoted an old saying about recovering from a broken relationship: “The only way to get over somebody is to get under somebody,” she chuckled. “I just think it takes another job.”

Marcia Cross, who plays neurotic super-homemaker Bree, insisted she hadn’t meant to break the news to Huffman in that e-mail.

“Felicity is always on top of everything, while I’m usually four steps behind,” explained Cross, who said she was alerted by her manager. “It didn’t occur to me that she didn’t already know.”

“I was really glad to hear it from you,” Huffman told her as they commiserated.

“I thought it was coming and I think it’s the right thing,” Cross said. “But I still feel very sad and discombobulated.”