Ally Financial announced Tuesday that it has agreed to buy the online brokerage firm TradeKing Group for about $275 million.

TradeKing, of Fort Lauderdale, Fla., has roughly $4.5 billion in client assets. The 11-year-old firm allows its users to make self-directed trades, invest in professionally managed portfolios and interact with one another digitally.

"The addition of wealth management is the next key step in Ally's digital product evolution," Ally CEO Jeffrey Brown said in a press release.

The acquisition will drive efficient deposit growth and diversify Ally's revenues by adding fee-based income, Brown added. TradeKing advertises stock trades at $4.95 per trade.

The deal, which is expected to close in the third quarter, is part of Ally's strategy to start offering more products to depositors at its digital banking franchise. Ally officials said in February that they plan to add a credit card and mortgages later this year.

"Ally has a loyal and growing base of customers who have a need for wealth management services and continually ask us to expand our offering," Ally Bank CEO Diane Morais said in the press release.

"We also believe there is an opportunity to offer TradeKing clients competitive deposit products that can enhance their overall savings strategies," Morais said.

Ally said that the $275 million purchase price is subject to certain adjustments and represents approximately $250 million in premium to the acquired net assets.

The Detroit-based auto lender expects the transaction costs to have a marginal impact on its 2016 and 2017 results, with the deal becoming accretive in 2018.

Ally also said that the acquisition, which is subject to regulatory review, would have no impact on its plan to pursue common stock dividends and a common stock repurchase program as part of its 2016 capital plan. That plan has yet to be approved by regulators.

The TradeKing deal was announced weeks after Ally reached a truce with Lion Point Capital, an activist hedge fund that had asked Ally's board to explore a potential sale or other strategic alternatives.

Lion Point dropped that demand after Ally agreed to consult with the hedge fund on the appointment of an independent director to Ally's board.

Lion Point and other investors have been frustrated with the performance of Ally's stock, which has fallen by about 25% since the firm's initial public offering two years ago.

Shares in Ally were down by 2.4% in midday trading Tuesday, against a smaller decline in the S&P 500.