Morgan Stanley is betting its future on Main Street.

The Wall Street giant moved further from its investment banking origins on Thursday with an agreement to buy the discount brokerage firm E-Trade for about $13 billion, the biggest takeover by a major American lender since the 2008 global financial crisis.

The addition of E-Trade would allow Morgan Stanley to tap into a new source of revenue: the smaller-volume trades of the country’s so-called mass affluent, people who are wealthy enough to have some savings but not rich enough to buy into hedge funds or seek out a money manager. If it goes through, the deal will put Morgan Stanley, which does not have retail bank branches to draw in new asset-management customers, on firmer footing with competitors like Bank of America and Wells Fargo.

It would also give Morgan Stanley a big share of the market for online trading, an additional 5.2 million customer accounts and $360 billion in assets.

Morgan Stanley’s chief executive, James P. Gorman, said the merger would disrupt neither E-Trade clients nor Morgan Stanley customers, but ultimately result in more services for all.