LOS ANGELES — Discovery Communications and Scripps Networks Interactive have reached an $11.9 billion deal to combine, a move aimed at creating a bulwark to withstand the challenges facing the television industry.

Discovery plans to acquire Scripps – the owner of HGTV, Food Network and the Travel Channel – in a cash-and-stock transaction that was announced early Monday. The combination would create a bulked-up programming company commanding nearly 20 percent of cable viewership in the U.S. and significant growth prospects globally.

The proposed marriage of the two cable programming companies comes after two failed attempts to merge. However, this time the companies were spurred to combine because it has become increasingly difficult for medium-sized independent media firms to stand on their own.

The Discovery-Scripps combination would create a more formidable entertainment company, one with several must-have cable TV channels. The deal is expected to close in early 2018.

“This is an exciting new chapter for Discovery. Scripps is one of the best run media companies in the world with terrific assets, strong brands and popular talent and formats,” David Zaslav, CEO of Discovery, said.

Both Scripps – which boasts among the country’s most popular lifestyle channels – and Discovery have been grappling with lower TV ratings and increased competition for viewers. Consumers have been dropping their pay-TV subscriptions in favor of lower-cost digital streaming options, including Hulu, Netflix and Amazon.com.