The Bay Area's accelerating home prices last year made handsome profits for home flippers -- investors who snap up houses only to sell them again within six months -- with the South Bay leading the nation in the average profit before expenses, according to a report released Thursday.

But as low-priced foreclosures dried up and the inventory of other lower-priced homes fell to record lows, investors found little to buy, fix up and flip at a profit, RealtyTrac reported.

RealtyTrac defines a home as flipped if it was sold twice in a six-month period to buyers who are unrelated to each other.

The South Bay had 745 such sales last year, a 24 percent decline from 2012, RealtyTrac said. The average gross profit was a record $162,042.

The larger San Francisco metro area, which includes the Peninsula, San Francisco, Marin County and the East Bay, scored the third-highest profit nationwide -- $155,616 -- per sale. The number of flipped homes increased 1 percent to 2,057.

"It's a tantalizing market where the profits are great but the availability of homes is scarce," said Daren Blomquist, vice president of the Irvine housing data company.

The year's rapid price run-up in the Bay Area was catnip to investors, said Geraldine Barry, president of the San Jose Real Estate Investors Association and publisher of REI Voice magazine.

"For those who weathered the storm in the last cycle, this year has been very good to them," Barry said.

"We enjoyed double-digit appreciation, 30 percent in some areas," Barry said. She expects appreciation to continue this year, but not at those levels.

Barry said that nationally, smaller investors were challenged by big hedge funds that swooped in and snatched up lower-priced homes. "They drove a lot of investors out of the market because they could not compete with the deep pockets," she said.

In the South Bay, the average flipper bought a home for 16 percent less than the prevailing market value and sold it for 4 percent more, RealtyTrac said. In the San Francisco metro area, flippers bought at a 13 percent discount and sold at an 11 percent profit.

RealtyTrac's Blomquist said there's "one last surge" of home flipping ahead, but that the market will continue to decline in the Bay Area.

"We do see a potential for one last surge in foreclosure activity in California in 2014 as lenders push through their last batch of foreclosures," he said.

"But in general, the best window of opportunity is past in most California markets because we're past the worst of the foreclosure crisis and home prices have accelerated so quickly. That's not favorable for flippers."

For California, home flipping was up 6 percent and the average sale returned a profit of $99,999. The average profit for the U.S. was $58,081 on a 4.6 percent increase in sales.

Contact Pete Carey at 408-920-5419. Follow him at Twitter.com/petecarey.