Katie Sleep and her husband, Jonathan, lived in the same four-bedroom home in a Washington suburb for 23 years.

After Sleep decided to retire, they began looking for a new house, and, after viewing a model home in a new development, decided to move to Leesburg, Va., about 40 miles from the city.

In having their new home built, they saw an opportunity - not to downsize, but to create a far larger home catering to their every need.

In April 2012, they selected a model costing about $850,000 from a luxury builder and chose a number of standard options for an additional $650,000. Sleep, who was in the process of selling the software firm she founded nearly two decades earlier, added a wall of windows to the basement and furnished it with a pool table, a media room, a wet bar, a home office and a suite for their youngest daughter to use when she was home from college.

They added a second master bedroom suite, on the ground level, for use when they are older and stairs become tougher to climb. They upgraded floors, carpeting and molding, added a sunroom and a large deck and supersized the garage door to fit Sleep's Cadillac Escalade. The home's lighting and temperature, as well as media on any of 14 televisions and the sound system, can be controlled remotely.

This six-bedroom house, which has six full- and three half- bathrooms, measures about 9,000 square feet, including the basement. The Sleeps expect to spend an additional $250,000 to landscape its three-acre lot.

"We went through some hard times with the software company," Sleep, 57, says. "We feel blessed that we live here now. We pinch ourselves all the time."

After the recession, the market for large, expensive homes like theirs slowed sharply.

In July 2008, according to the National Association of Realtors, the number of homes that sold for $750,000 to $1 million dropped by 35.5 percent, compared with the previous July. Those that sold for more than $1 million fell 31.4 percent.

Yet despite the bursting of the housing bubble, the ensuing recession and the slow recovery, buyers have not abandoned luxury homes. It turns out that they just took a break. In July 2013, sales of homes costing more than $1 million were up 46.6 percent from the previous July.

When it comes to new homes, bigger is again better. The median size of new homes built for sale peaked in 2007 at 2,295 square feet, then fell to 2,159 two years later, after the housing crisis hit. But the appetite for ever-larger homes has returned: In 2012, new homes reached a new peak of 2,384 square feet and, according to the National Association of Home Builders, some 41 percent of new homes had four or more bedrooms, up from 34 percent in 2009.

"The housing market is being driven by the move-up buyer, the luxury buyer," says Brad Hunter, chief economist and director of consulting at Metrostudy. "And those who have strong incomes, secure jobs, their stock portfolio is doing well - they are able to buy whatever they want. And what they are buying is larger houses."

Toll Brothers, the publicly traded company that built the home for the Sleeps, has benefited more than others from that demand, Hunter says, because it caters to the luxury market. In December, the company reported that its revenue was up 65 percent in its fiscal fourth quarter, versus the same quarter the previous year. The average sales price for its homes was up 21 percent for the same period.

Affluent buyers have been flocking to real estate, according to the Mortgage Bankers Association, with applications for home loans of $625,000 to $729,000 up 56.7 percent from August 2012 to August 2013. Mortgage applications for more than $729,000 were up 41 percent.

At the same time, the lower end of the market is stalling. Mortgage applications for homes of less than $150,000 fell 0.6 percent in that period.

"First-time buyers are having trouble coming up with the down payment and qualifying for mortgages," Hunter says. "They are coming out of college with huge amounts of student loan debt, which makes it more difficult to handle significant monthly payments, to save a down payment and to qualify for a loan based on their debt ratios."

Affluent buyers are drawn to new homes in part because the market for existing homes is so competitive, says Stephen Kim, a Barclays analyst.

Inventories of existing homes for sale remain low, and buyers are less interested in large homes in far-flung developments. Those homes have struggled to regain their value, according to Lawrence Yun, chief economist at the National Association of Realtors, and affluent buyers want established suburban communities that are closer to job centers and have good schools. And builders are finally starting to put up more houses: Housing starts rose 18 percent in 2013.

When Dr. Jonathan Cohen, a physician in Orange County, Calif., began looking for a home with his wife and young son, they were outbid on one after another. Frustrated, he visited a new development in Yorba Linda, among the country's wealthiest communities, where he later bought a five-bedroom, 4,600-square-foot home with a double-height foyer.

Cohen, 35, and his wife, Esther, also a physician, saved for two years to buy it. In total, they spent about $80,000 upgrading the home, which ended up costing about $1.2 million. It's within a reasonable commute to work and in a good school district, Cohen says.

"Before doing this, we were very concerned that the market could drop again," he says. "But I am getting a brand-new home with a 10-year guarantee if anything breaks, built to my specs. It's a decent size, a great piece of property. If I am going to put money into property now, I can't think of a better investment opportunity."