Ten years ago today, the TV biz was jolted by the news that the WB Network and UPN would lay down their arms after 11 years of battle and join forces as the CW.

In hindsight, the biggest surprise is that the news of the netlets’ merger deal stayed secret until the leaders of their respective parent companies — CBS Corp.’s Leslie Moonves and Warner Bros.’ Barry Meyer — announced it at a hastily arranged news conference that morning at Manhattan’s St. Regis Hotel.

The sides had engaged in stealth negotiations for a little more than two months. The effort, code-named “Project S,” was primarily led by Meyer and Bruce Rosenblum, then Warner Bros. TV Group president (now president of Legendary TV and Digital), and CBS chief Moonves and Nancy Tellem, then CBS Paramount Television Entertainment Group president.

The talks were held in the executive suites at CBS and Warner Bros., and occasionally in a secluded booth in the bar of the Bel-Air Hotel. The tight circle helped keep a lid on rumors.

“We were shocked that it stayed quiet,” recalls Dawn Ostroff, the UPN entertainment president who was tapped to lead the CW as entertainment president alongside WB vet John Maatta, who became the CW’s chief operating officer. “It was a tribute to Barry Meyer and Les, who were good friends and trusted each other implicitly. And everyone involved in the deal was loyal to both of them.”

The timing of the union was not accidental. Both WB Network and UPN were coming up on what promised to be tough affiliation renewal negotiations with their core station groups. And as of Jan. 1, 2006, CBS Corp. had formally split off from Viacom. Six years after Viacom acquired CBS, Sumner Redstone decided that the two sides of his media empire would be better off apart.

The UPN-WB merger plan was sparked by a conversation between Moonves and Meyer during a dinner party at Haim Saban’s lavish Beverly Park home held just before Thanksgiving in 2005. The CEOs realized they were facing a window of opportunity that they would be foolish to ignore. Both nets were still losing money after more than a decade on the air. (WB and UPN launched within days of each other in January 1995.)

The nets had previously flirted with merger talks but nothing ever became serious. WB execs had also put out feelers with ABC and NBC about possible partnerships. By the time Meyer and Moonves, who previously worked for Meyer as president of Warner Bros. TV before joining CBS, struck up the conversation at Saban’s house, the leaders were ready to put their corporate egos aside for the sake of getting a deal done.

“We thought that if we didn’t take this opportunity to put those struggling networks together, our shareholders should fire us both,” recalls Meyer, who retired from Warner Bros. in 2013.

That didn’t mean it was easy for everyone. Dozens of people on both sides lost their jobs as a result of the integration. As Variety noted days after the Jan. 24 announcement, “stunned employees and execs were still huddling at the WB’s Burbank ranch headquarters and UPN’s West L.A. digs, trying to figure out where they stand.”

Ostroff, who left CW in 2011 and is now president of Conde Nast Entertainment, recalls that they talked even then about whether the new-model CW should be delivered from the start via the Internet as well as broadcast stations. YouTube at the time was a fledgling entity that was months away from being acquired by Google, but it was a harbinger of the upheaval to come.

“We knew the (TV) world was going to change, but it felt like it was too early at the time,” Ostroff said.

It’s no secret that CW’s output deals with Netflix and Hulu saved the network from extinction just a few years ago. In the past few months, the CW has engaged in high-stakes renewal discussions with Netflix.

In 2006, the mandate to keep the merger news quiet was intense. As UPN and WB were part of public companies, they had to be careful about when disclosures were made to shareholders. Moreover, if word got out but the deal didn’t come to pass, both sides would be embarrassed.

CBS and Warner Bros. were so intent on surprising the TV biz — much of which was in Las Vegas for the annual NATPE convention that week — that invitations to the news conference were sent out that morning by an outside firm, Rubenstein Communications. There were no references to CBS or Warner Bros. — just the promise of an announcement of “a new broadcast network.”

Joining Moonves and Meyer that day was Dennis FitzSimons, then CEO of Tribune Co. The Tribune station group that day announced a 10-year affiliation pact with the CW as a show of faith in the merged entity. A renewal of that deal is now being wrangled by new regimes at CW and Tribune Media amid a very different business landscape for both sides.

Despite the focus on secrecy, the sides took a gamble the night before the news conference by going out en masse for a celebratory dinner at the Post House restaurant on the Upper East Side.

The final-final paperwork on the deal wouldn’t be finished until minutes before Moonves and Meyer stepped out from behind the curtain at the St. Regis ballroom on Jan. 24. But the die was cast over toasts and T-bones the night before, and the CW began zooming toward its Sept. 18, 2006, launch date.

Meyer’s biggest memory of the news conference was the feeling of accomplishment at having pulled off a complicated agreement in a short time, a process made easier by the friendship and respect that existed among the principal players.

“Sometimes, you just get the right deal at the right time,” Meyer says.