A long-predicted move toward consolidation in the online brokerage sector began Wednesday with Ameritrade's ( AMTD - Get Report) $2.85 billion all-stock acquisition of TD Waterhouse.

The deal is an expensive one for Ameritrade, which is trying to fend off a semi-hostile takeover attempt by its heretofore bigger rival, E*Trade ( ET - Get Report). Including a special $6 cash dividend to its shareholders -- a gift that will be funded mostly through borrowed money -- the company will oversee the transfer of more than $5 billion in value when all is said and done.

TD Bank Financial, the parent of TD Waterhouse and a division of Canada-based Toronto Dominion ( TD - Get Report), will initially own 32% of the new company, which will be called TD Ameritrade.

The stake will grow to 40% after a post-merger tender offer. Indeed, one of the deal's consequences will be a far greater concentration in Ameritrade's shareholder base. Another 23% of the stock will be controlled by Ameritrade's Ricketts family when the merger is completed.

The deal, which has been speculated for weeks, was announced early afternoon when the stock was trading at $14.99. After the terms became public, shares of Ameritrade soared higher, rising $2.41, or 17%, to $17.23 going into the close.

The merger would create one of the largest online brokers with nearly 6 million customer accounts, about $1.8 billion of annual revenue and more than $200 billion in client assets. The companies claim the transaction will create the largest online brokerage based on daily trading volume.

Wednesday's agreement leaves in the lurch an effort by E*Trade to pick off Ameritrade, which had previously rejected a cash and stock merger offer worth about $5 billion.

Under the deal announced Wednesday, Ameritrade will issue about 190 million shares to TD Bank. The new company will be led by the current Ameritrade CEO Joe Moglia.

In a conference call, Moglia said in merging with TD Waterhouse, Ameritrade gets a physical presence on the ground by acquiring a big network of branches. The Omaha-based brokerage also gets access to a major bank, something it had sorely lacked.

The merger comes at a time of an all out price-war in the online brokerage business with rivals slashing trading costs in order to attract customers and drive trading. Unlike the golden years of the late 1990s, the online brokerage business has become a much more difficult place for numerous firms to survive.

Analysts have been predicting for some time that consolidation would eventually come to the industry. The Ameritrade/TD Waterhouse deal is likely to lead to feverish talk of other deals.

In fact, even though it was a loser in the bidding war for Ameritrade, shares of E*Trade rose 80 cents, or 6%, to $13.71 on the news. The deal also could pressure on Charles Schwab ( SCH), the nation's largest discount brokerage to pull off its own deal.

Ironically, a potential deal last year between E*Trade and TD Waterhouse faltered over issues of which company would control the brokerage.

"Don't assume consolidation is over for the industry and that it's over for Ameritrade," said Moglia.

In the online brokerage sector, Ameritrade has been one of the main acquirers. Two years ago, Ameritrade acquired Datek, a brokerage favored by many day traders, in a deal valued at $1.3 billion. In that acquisition, Ameritrade bested rival bids from E*Trade and TD Waterhouse.

Before Datek, Ameritrade acquired National Disount Brokers in 2001.

Meanwhile, in a key sweetener designed to distract investors from a reported $17.50-a-share bid by E*Trade, Ameritrade shareholders will get a $6 special dividend worth about $2.4 billion. The payout will be funded through excess cash, borrowing and a contribution from TD Bank.

TD Bank will also tender for about 8% of the new company's outstanding stock at $16 a share after the dividend is paid.

The lure of the special dividend, however, isn't impressing all investors. Michael Stead, a portfolio manager for River Aire Investment, which mainly invests in financial stocks, says he sold his shares of Ameritrade shortly before the deal was announced. He says he would have preferred Ameritrade accepting the bid from E*Trade and is not disappointed he's missing out on the special dividend.

"They are clearly not interested in shareholder value, therefore it's time to go,'' says Stead, who sold his shares when the stock was trading around $15. "To hang around for a special dividend is something I'm not willing to do. I think there are better opportunities elsewhere."

The deal also has the backing of the family of Ameritrade founder Joe Ricketts, which owns about 34% of the company's outstanding stock.