E-Trade Financial Corp. yesterday agreed to pay $700 million in cash for competitor Harrisdirect, the latest turn in a square-dance of mergers taking place in the online brokerage industry.

Online stock brokerages, which gained vast popularity in the late 1990s as millions of day traders used the Internet to buy and sell stocks, have declined in the past two years as day trading all but evaporated with the collapse of the tech boom.

In response, they are seeking merger partners to bulk up their client base and attempting to diversify into other financial businesses, such as investment advice and consumer banking.

Several small online brokerages were snapped up over the past several years; now the consolidation has kicked into high gear, with the largest players jockeying for dominance. Soon, analysts predict, the vast majority of online stock trading will be done through as few as three or four major companies.

"This is a macro trend with very sound business reasons behind it," said William F. Cline, global managing partner in consulting firm Accenture's capital markets business. "What you're seeing is that scale still matters."

The quest for that scale began in May, when E-Trade's uninvited offer for industry leader Ameritrade was rebuffed. After refusing E-Trade's multibillion-dollar cash and stock bid, Ameritrade agreed in June to buy TD Waterhouse for a price widely estimated to be about $3 billion.

Yesterday, E-Trade turned to a much smaller merger partner. Harrisdirect is the New York-based online brokerage arm of Canada's Bank of Montreal and is considered valuable more for the rich demographics of its customer base than for its size.

Depending on which measurement is used -- total customers or average trades -- the industry leaders are Ameritrade and Boston mutual fund giant Fidelity, with Charles Schwab's online service and E-Trade third and fourth. E-Trade has about 3.6 million brokerage accounts, while Ameritrade after its merger with TD Waterhouse will have about 5.9 million accounts.

Mitchell Caplan, E-Trade's chief executive, said that while the Harrisdirect deal reflects the realities of an industry in which scale and size will be paramount, E-Trade is not looking for size alone. E-Trade, unlike any of the other major online brokerages, receives most of its revenue from consumer banking and other financial services delivered online. In the second quarter, only 19 percent of its revenue was from trading commissions, he said.

"Everyone tends to be myopically focused on online trading, that the opportunity now tends to be in scaling up online trading," he said in an interview yesterday. "But you can look at lots of other services. We're only in the second inning of the consolidation game. You'll see it within [online trading] and you'll see it in financial services at large."

E-Trade is based in New York, though its largest operating division and most of its corporate offices are in Arlington. Caplan was chief executive of the Arlington's Telebanc Financial Corp. when E-Trade bought it five years ago, only to see the old Telebanc business dominate E-Trade in the years to come and insulate the company's earnings from the vagaries of the stock market.

E-Trade earned $101 million on $391 million in revenue in the second quarter. Though paying all cash for Harrisdirect, E-Trade still has more than half a billion dollars to do further acquisitions.

Cline said the question, after all the mergers, is how well these companies can be put together.

"Execution is going to play a big role in determining the winners and losers," he said. "It will depend on how quickly the organization can realize the benefits from the merger. The speed and quality of execution is what matters ultimately."

E-Trade shares rose $1.24, or 8.3 percent, to close at $16.09 yesterday on the New York Stock Exchange.

E-Trade bought Bank of Montreal brokerage Harrisdirect after being spurned by industry leader Ameritrade, as big online brokers jockey for dominance.