December 30, 2022 | 11:26 p.m

Barbara Walters knew it was time.

In the midst of her 16th season on “The View,” the legendary journalist cryptically asked ABC executive Anne Sweeney to write down the year 2014 on a piece of paper while having lunch together.

It was March 2013, and Walters had just returned to the talk show after suffering a series of health setbacks, including a fall and a bout with chicken pox.

Just a few months after their lunch, Walters asked Sweeney whether she still had the paper and informed the exec that 2014 was the year she planned to retire from the broadcast career that made her a household name.

Barbara Walters retired from “The View” — and a five-decade career — in 2014.
Disney General Entertainment Con

“She picked her date,” Sweeney recalled to journalist Ramin Setoodeh in his 2019 book, “Ladies Who Punch: The Explosive Inside Story of ‘The View.’”

At first, the network was afraid of losing the trailblazing newswoman who created and co-hosted “The View,” one of its most successful (and controversial) series, since 1997. But as the year went on, Walters’ health continued to deteriorate, and it soon became clear that the 84-year-old could not go on working.

“One day, just as the show ended, she collapsed into the arms of a stage manager,” Setoodeh wrote.

“She had to be taken to the greenroom, where they laid her down on a sofa. The staff called the paramedics.”

The journalist suffered multiple health scares during her final year on “The View.”
Disney General Entertainment Con

Walters was “concerned that the sight of her on a stretcher would make it into the papers,” according to the book, but she eventually agreed to see a doctor and was back on set the next morning.

“Barbara acted like it was business as usual,” Setoodeh noted.

As Walters’ retirement drew near, there was much pomp and circumstance.

ABC aired a two-hour primetime special chronicling her career, the network’s news division renamed its Upper West Side headquarters the Barbara Walters Building and original “View” co-hosts including Meredith Vieira and Star Jones returned to the show to celebrate Walters’ 17th and final season.

The Emmy winner’s last episode aired in May 2014 with special guests Hillary Clinton, Michael Douglas and Oprah Winfrey. As she bid farewell to the audience, the woman of the hour said she looked forward to taking “a deep breath” so that she could “enjoy [her] view.”

Walters did not fade into the background for long, though. She returned as a guest co-host throughout 2014 and 2015 before finally settling into life as a retiree.

The former “20/20” host died Friday at her home in New York. She was 93.