This story has been updated.

TD Ameritrade Holding said on Monday it and Toronto-Dominion Bank td would buy privately held Scottrade Financial Services in a deal valued at $4 billion, combining two of the biggest U.S. discount brokerages.

TD Ameritrade amtd , the biggest U.S. discount brokerage by trade executions, said it would end up paying $2.7 billion for Scottrade’s brokerage business after the sale of Scottrade Bank to Toronto-Dominion Bank’s U.S. banking unit for $1.3 billion.

The $2.7 billion comprises $1 billion in new common TD Ameritrade shares and $1.7 billion in cash.

The deal comes at time when discount brokerages are facing weak trading volumes and slow revenue growth as wealth managers cut fees amid intense competition.

 

Rodger Riney, who founded Scottrade and is the company’s CEO and controlling shareholder, will join TD Ameritrade’s board after the close of the deal, the companies said. Riney said last year he was being treated for a form of blood cancer.

TD Ameritrade, which is 42% owned by Toronto Dominion Bank, said it expected to save about $450 million annually in combined expenses and more than $300 million in “additional longer-term opportunities” once the deal closes.

The deal is expected to close by Sept. 30, 2017, the companies said.

Barclays Capital is financial adviser to TD Ameritrade, while Wachtell, Lipton, Rosen & Katz is legal adviser. Goldman Sachs is advising Scottrade, with Sullivan & Cromwell acting as legal adviser.