San Francisco-based Wells Fargo (NYSE:WFC) has emerged from the collapse of the U.S. housing bubble as the nation’s dominant mortgage lender, grabbing an unprecedented 28.8 percent share of all home loans issued nationwide last year, The Wall Street Journal reports.

That figure is up from 11.2 percent in 2007, the year before Wells Fargo purchased Wachovia. Its home-loan production hit $524 billion last year, the largest annual total ever for one lender and more than the output of the next five largest lenders combined, according to the publication Inside Mortgage Finance.

In the lucrative Manhattan market, Wells issued almost 20 percent of new home loans—almost equal to the volume of its two biggest competitors together, according to real estate research firm CoreLogic Inc. In San Francisco, it made 21 percent of new loans, in Los Angeles, 12 percent, and in Dallas, 9 percent.

Only four years after nearly bringing down the U.S. financial system, mortgage lending is again churning out big profits for American banks. The lowest interest rates in more than 60 years have sent homeowners on a refinancing binge. Banks, after being burned by their own sloppy lending before the financial crisis, have tightened their credit standards, and say this makes their new loans much safer.

The question now facing Wells Fargo and its rivals is what comes next when the refinancing waves abates. Loans to purchase homes accounted for only a quarter of the mortgage industry's production last year. Mortgage refinancing accounted for three quarters, and that is likely to crash if and when interest rates start rising again. Timothy Sloan, Wells' chief financial officer, told investors last month that he expected mortgage revenues to decline in the first quarter—a sign that refinancing may have started slowing.

The mortgage operations of U.S. banks and thrifts reported profits of $31.9 billion last year, about six times the $5.2 billion notched in 2011 and the most in at least a decade, according to Inside Mortgage Finance. Wells Fargo recorded income of $11.6 billion from mortgage banking last year, up nearly 50 percent from 2011. Overall net income was $18.9 billion, more than double the company's profit in 2007, the year before the Wachovia acquisition.

Wells has taken a commanding position partly at the expense of its biggest competitor. Bank of America Corp. (NYSE:BAC) briefly became the nation's largest housing lender after its 2008 acquisition of lending giant Countrywide Financial, which had been No. 1. But that deal soured quickly as the housing market deteriorated, saddling Bank of America with hundreds of thousands of defaulted loans and billions of dollars in legal expenses.

That forced BofA to stop buying mortgages originated by other lenders. Its share of the mortgage market plunged to 4.3 percent last year, from 21.6 percent in 2009.

Wells bought Wachovia, then the third-biggest U.S. bank by domestic deposits, at the peak of the 2008 financial panic. Wachovia was about to fail, thanks to a large portfolio of risky mortgages it got when it acquired a California-based mortgage lender in 2006.

Because many of the Wachovia loans hadn't been bundled into mortgage securities and resold to investors, Wells was eventually able to restructure them. Wells had made its share of subprime loans and risky home-equity loans during the housing boom, but it hadn't loosened credit standards as much as some other large lenders.