Verizon Communications won an intense bidding war to buy Straight Path Communications for more than $3 billion, beating out AT&T.

Verizon will acquire Straight Path for $184 a share in an all-stock transaction, reflecting an enterprise value of approximately $3.1 billion, the companies said.

Straight Path and Verizon's boards have both approved the deal.

Straight Path was worth around $400 million two months ago and had just nine employees as of October.

The company's large trove of 28 GHz and 39 GHz millimeter wave spectrum used in mobile communications would give a new owner an advantage in 5G development.

Verizon will pay a termination fee of $38 million to AT&T on behalf of Straight Path.

Verizon and AT&T are seeking to gain an edge in the race to develop a fifth-generation network (5G) that would offer faster downloads and boost internet-reliant products such as self-driving cars.

Evercore served as financial advisor to Straight Path and Weil, Gotshal & Manges served as counsel. Debevoise & Plimpton served as counsel to Verizon.

News of the acquisition was first reported by the Wall Street Journal.