LONDON — The Finnish telecommunications company Nokia said on Wednesday that it had agreed to an all-stock deal to acquire Alcatel-Lucent that valued its French rival at about $16.6 billion.

The combined company is expected to become the world’s second-largest telecom equipment manufacturer, behind Ericsson of Sweden, with global revenues totaling $27 billion and operations spread across Asia, Europe and North America.

The companies are betting that, by joining forces, they can better compete against Chinese and European rivals bidding to provide telecom hardware and software to the world’s largest carriers, including AT&T and Verizon in the United States, Vodafone and Orange in Europe, and SoftBank in Japan.

The announcement came after the companies said on Tuesday that they were in advanced talks over a deal, which would represent the latest in a string of mergers in the fast-consolidating telecom sector.