Verizon Communications Inc. agreed to buy AOL Inc. in a $4.4 billion deal aimed at advancing the telecom giant’s growth ambitions in mobile video and advertising.

The all-cash deal values AOL at $50 a share, a 23% premium over the company’s three-month volume-weighted average price. AOL shares rose 18% in morning trading to $50.18. Verizon shares fell 1.7% to $48.98.

The...