Some of Wall Street’s biggest investors are sitting on a paper windfall this year as the government ratchets up a debate over the future of mortgage-finance giants Fannie Mae and Freddie Mac .

The increased rhetoric has so far led to a surge in the companies’ shares and paper profits for their investors, including mutual-fund giant Capital Group Cos. and hedge funds Discovery Capital Management LLC, Blackstone Group ’s GSO Capital Partners LP, Paulson & Co., Perry Capital and Pershing Square Capital Management LP, said people familiar with the matter.

For more than a decade, lawmakers have tried and failed to overhaul Fannie and Freddie, which were placed in conservatorship during the 2008 financial crisis. But recent statements by administration officials indicating the government plans to move soon on taking the firms out of conservatorship have sent shares surging. The common shares of Fannie and Freddie are up more than 170% this year, while the most commonly traded class of the preferred shares, a form of senior equity that used to pay a dividend, are up more than 37%.

Several of the funds own different classes of preferred shares. Pershing Square largely owns common shares.

Hedge funds have been betting on Fannie and Freddie’s privatization for years. They have pressed their case for much of that time with lawmakers, but have been buffeted by political and legal developments that have swung the companies’ shares wildly. The trade has run for such a long time—a decade for some—that some early investors in it are closing down or have dramatically different businesses now.