Financial advisor to banks bought for $575 million by Stephen Gandel @FortuneMagazine November 5, 2012, 7:31 PM EST E-mail Tweet Facebook Google Plus Linkedin Share icons Correction: 11/6, 9:30 A.M. FORTUNE — Stifel Financial, a brokerage and investment firm based in St. Louis, will pay $575 million to buy KBW, a Wall Street firm that specializes in advising financial firms. The price, which translates to $17.50 a share for KBW KBW , is less than 10% above the $16.30 KBW’s stock had been trading at before the deal. Nonetheless, the deal, which is being done as a mixture of cash and stock, is another sign that many believe the U.S. financial system is still in need of an overhaul in the wake of the financial crisis and Dodd-Frank regulatory reforms. Advisors like KBW, which is short for Keefe, Bruyette & Woods, should benefit. Stifel has recently been looking to take advantage of changes in the financial markets. The firm recently made a strategic investment in restructuring firm Miller Buckfire. Shares of Stifel SF were up nearly 2% after the KBW deal was announced to a recent $32.40. MORE: How Goldman narrowly misses a Hurricane Sandy disaster “It’s fairly clear that 50% of the banks in the U.S. need to be recapitalized,” says Rochdale Securities bank analyst Dick Bove. Large banks have said that new financial reforms will make it nearly impossible for them to grow bigger. Bank CEOs like JPMorgan Chase’s Jamie Dimon have all but ruled out acquisitions. But analysts believe there could be a wave of consolidation among smaller and mid-sized banks over the next few years. Some small banks have complained that financial reforms and increased scrutiny from regulators have made it hard for them to continue. A number of mid-sized banks still need to raise money to fill the capital they lost in the financial crisis. On top of that, the shifting mortgage market is creating opportunities for new firms. In the past year, KBW has advised on $245 million worth of equity deals, including offerings for Salt Lake City-based Zions Bancorp and mortgage REIT Annaly Capital. Three quarters of its equity deals were for financial firms. The rest of them were for companies in the real estate business. KBW’s clients are generally small and mid-sized banks, but it recently landed co-underwriter positions on the IPOs of a number of private equity firms including Carlye Group and Oaktree. KBW, which was founded more than 50 years ago and has over 500 employees, has had a storied and resilient past. In 1999, the firm’s then CEO James McDermott was charged with insider trading for passing along stock tips to a porn star he was dating. McDermott was forced to resign. Two years later 67 employees of KBW, which was based in the World Trade Center, died on 9/11, including its chairman and co-CEO Joseph Berry. MORE: Was the gas shortage preventable? The firm, which is now located in midtown Manhattan, survived and thrived in the mid-2000s. Recently, though, KBW has struggled, losing business to rivals. According to Thomson Reuters, KBW ranks 28th among investment banks in terms of completed equity offerings this year. That’s down from 13th two years ago. Last month, a judge said a trustee for Guaranty Financial Group could go ahead with lawsuit against KBW, claiming the firm used insider information to profit from the demise of the Austin-based financial firm, which filed for bankruptcy in 2009. Kenneth Tepper, the trustee, alleges that bankers at KBW repeatedly bet against Guaranty Financial’s stock while acting as the firm’s adviser. The suit seeks $20 million in damages. Correction: An earlier version of this story said that Stifel bought Miller Buckfire. In fact, Stifel only made a strategic investment. Miller Buckfire is still independently owned.