The New York Stock Exchange, the cornerstone of American capitalism for 220 years, agreed to be sold as part of an $8.2 billion takeover by IntercontinentalExchange Inc.

If regulators and shareholders approve, the combined company would own 14 stock and futures exchanges and five clearing operations that serve as middlemen between buyers and sellers of futures and other contracts, doing more things in more places than any other rival.

The...