Robin Weigert was getting her life together when “Deadwood” last aired in 2006 — 13 years before it returns Friday on HBO as “Deadwood: The Movie.”

She’d received an Emmy nomination for her portrayal of Calamity Jane on the HBO series (2004-06) and its profile, and popularity, were on the rise — as was Weigert’s bank account. When she put a down payment on an apartment in Manhattan, she appeared the symbol of stability. “It was one of those rare moments where you really do look good on paper,” Weigert says.

Then David Milch, the show’s creator, phoned her in May of 2006 with some bad news. HBO wasn’t picking up the options of the “Deadwood” cast, making a fourth season unlikely. “The whole edifice came crashing down,” she says. “It was a huge shocker.” Besides the “artistic devastation” of having to leave behind a character she loved, the financial picture was bleak. “I kept the apartment but had to rent it out to afford it,” says Weigert, 49. “David sailed in with an offer to purchase it from me. I was stunned for a moment and then you say, ‘No, no, I would never let you do that.’ ”

A movie version of the series was announced a month later and then the waiting began. It took years, particularly since the show’s cast had an unusually high post-show employment rate. Weigert landed the role of Dr. Amanda Reisman on HBO’s “Big Little Lies” (back for Season 2 June 9), while Timothy Olyphant, who plays Seth Bullock, got his own series, FX’s “Justified.” Molly Parker (Alma Ellsworth) joined the cast of “House of Cards.” Anna Gunn (Martha Bullock), played Walter White’s (Bryan Cranston) wife, Skyler, on “Breaking Bad.” Paula Malcomson, who was Trixie — one of Deadwood’s women of easy virtue — was Liev Schreiber’s wife on “Ray Donovan.”

Milch didn’t get the green light to write the script until 2016; the movie finally went into production at the Melody Movie Ranch in Newhall, Calif., in October 2018, with most of the original cast (including Ian McShane, Gerald McRaney and John Hawkes) returning for an emotional reunion. “You couldn’t tear us away from each other,” Weigert says. “We hung out as much as we could. What was hard was saying goodbye again.”

In “Deadwood: The Movie,” premiering Friday on HBO, Calamity Jane drunkenly wanders into town on a mule, celebrating South Dakota joining the United States of America. There’s a parade, a land auction and a wedding. And plenty of guns and ghosts: “It has things that haunt her,” Weigert says of Deadwood. “The ghost of Wild Bill Hickok (Keith Carradine). For that reason, [any place that] has Joannie Stubbs (Kim Dickens) in it has become an idea of salvation for her. That is the driving force.”

Weigert says Jane is at a crossroads. “Down one path is death. Down the other path there’s hope, a possibility of love and some measure of joy. History tells us what happened to the real Jane Cannery. But I hope she found a bit of peace or healing. The whole movie has an aspect that’s wish fulfillment. Some forces are powerful enough to rise up against those who are trying to keep you down.”

Although Milch reportedly contemplated writing two more “Deadwood” movies, Weigert thinks one is enough. “It feels to me that [the story] has to conclude because of the Herculean effort of getting everybody back together again,” she says.

“Molly Parker is my hero because she had to finesse her role on the weekend because the show she’s on [‘Lost in Space’] wouldn’t go into second position to ‘Deadwood.’ She was on these chartered flights dressed in a space suit, getting off and getting into a corset.

“It was crazy.”