Charles Schwab (SCHW) - Get Report   formally agreed to buy TD Ameritrade (AMTD) - Get Report in an all-stock deal valued at approximately $26 billion, the companies confirmed on Monday.

Under the agreement, TD Ameritrade stockholders will receive 1.0837 Schwab shares for each TD Ameritrade share,  representing a 17% premium over the 30-day volume-weighted average price exchange ratio as of Nov. 20.

The takeover, which first surfaced as a rumor last week, follows last month's move by Schwab to eliminate commissions for its retail clients, setting off a so-called "zero commissions" war in the online brokerage space that hammered the sector and caused major changes to earnings forecasts.

"With this transaction, we will capitalize on the unique opportunity to build a firm with the soul of a challenger and the resources of a large financial services institution that will be uniquely positioned to serve the investment, trading and wealth management needs of investors across every phase of their financial journeys," said Schwab CEO Walt Bettinger.

Schwab earns roughly 8% of it revenue from trading commissions - vs. roughly 23% for TD Ameritrade - with the bulk coming from the net interest margin it makes from cash held in customer accounts. Its second-quarter net interest margin was 2.5%, the company said earlier this summer, down 6 basis points from the previous three-month period.

A combined Schwab and TD Ameritrade would have assets nearing $5 trillion, more than 24 million clients. The two firms recently generated total annualized revenue and pre-tax profits of approximately $17 billion and $8 billion, respectively.

The agreement, which has been approved by boards of both companies, will be subject to regulatory and other standard closing approvals. 

Bankrate.com's senior economic analyst Mark Hamrick pointed to other smaller rivals who will now face increased pressure to compete. 

"In a low, or no fees world, and one where interest rates are low and efficiencies gained from using sophisticated technologies are high, the pressure will be on other financial services rivals to try to keep up, or to gain further scale themselves," Hamrick said.  

"The risk is that they lose market share, including in smaller communities where more personal brick-and-mortar financial services are harder to come by," Hamrick added.

TD Ameritrade was up 3.32% at $49.73, while Charles Schwab fell 0.92% to $47.76. Rival E*Trade Financial (ETFC) - Get Report  was up 0.5% and Interactive Brokers Group (IBKR) - Get Report  rose 1.32%.