For the past five years, astute viewers of Sunday night television have borne witness to the ultimate battle for power, played out by a formidable field of warriors: baby dragons eager to spread their wings, power brokers willing to be castrated for their masters, claimants to the throne so convinced of their rightful destiny that they’ve redecorated the royal castle a hundred times in their minds.

And now “The Good Wife” is coming to an end.

When the drama premiered in 2009, it was immediately showered with attention, steadily finishing among the top 20 series in the Nielsen ratings and earning its star Julianna Margulies two early Emmys as outstanding actress. Margulies would pick up a third in 2014, but the buzz had died down.

When the series moved from Tuesdays to Sundays in 2011, it got lost in the carnage to edgier, bloodier fare, most notably “The Walking Dead” and “Game of Thrones.”

That was a crime. “The Good Wife,” which concludes this Sunday, has always been the most ambitious, most intoxicating soap opera. The stakes may not have been life or death, but you wouldn’t have known it the way its characters fought for position, most notably savvy litigator Alicia Florrick, who struggled to take her seat at the head of the table without sacrificing the healthy urge to book a nooner between depositions.

“The Good Wife” was originally sold to audiences as an upgrade to an old Lifetime network formula with Florrick gamely standing by her man (Chris Noth), a corrupt district attorney who used a news conference to confess his marital indiscretions.

But it soon became clear that creators Michelle and Robert King were interested in telling more than the tale of a woman scorned.

With Mr. Big tucked away in jail, the series squarely focused on the newfound independence of its head attorney and her quest to prove her worth to a blue-chip law firm, the tabloids and, most dauntingly, herself.

Give her a solo show, stat

Margulies, so impressive in the pilot of “ER” that producers scrapped the initial plan to kill her off, graduated to the top of her class with a complex, vulnerable performance of a woman on the verge of a nervous breakthrough. Despite the obstacles — the cheating husband, backstabbing business partners, ruthless prosecutors, certifiable judges — Florrick stood tall, often with a glass of wine in her hand for balance.

If “Ally McBeal” showed that women could manage in the courtroom, Florrick proved that they could own it.

The Kings, however, didn’t always serve their characters well. The story lines exposing the eccentricities of aging law partner Howard Lyman (Jerry Adler) always seemed more like an opportunity to make politically incorrect jokes about old people than any pointed statements about the trials and tribulations of seniors in the workplace.

The firm’s chief investigator, Kalinda Sharma, started off as an inspired twist on Sam Spade, but was eventually undermined by an ill-advised plot in which we have to believe she’d put up with an abusive husband, as well as off-camera differences between the actress who portrayed her, Archie Panjabi, and Margulies. Panjabi was written out of the show at the end of Season 6.

Network TV’s last stand

These are quibbles. Week in and week out, “The Good Wife” was the sharpest written, most addictive show on network television, a title it has held without any serious competition since “Friday Night Lights” went off the air five years ago.

So many office conversations on Monday mornings revolve around that hatchet to the head in the latest episode of “The Walking Dead” and how Jon Snow will adapt to a resurrection on “Game of Thrones.” I get it. Both shows have helped make the case that TV has never had more compelling dramas. But try to start a conversation about whether Florrick will run away with hunky Jeffrey Dean Morgan and open up a B&B in Sunday’s finale, and you’ll get a lot of blank stares, especially from men.

“Oh, my wife watches that show,” many will inevitably say.

Big mistake not joining her on the couch, fellas. I strongly suggest you go back and binge-watch all seven seasons. If after that, you think I’ve misled you, go ahead and sue.

I know a good attorney. 

njustin@startribune.com

612-673-7431

Twitter: @nealjustin