Home prices in German cities are soaring, recent reports show, with several logging double-digit price hikes because of increased demand and diminished supply. Investors have been getting in on deals in the country for some time, but now, with prices so high, investment potential could be limited, experts said.

Germany’s competitive economy and its proven ability to adapt in a fast-changing environment make the German housing market attractive at this time, said Thomas Veraguth, head CIO of Swiss & Global Real Estate Strategy at UBS Switzerland AG.

Berlin, Frankfurt, Munich and Hamburg, all rank in the top 10 best European cities to invest in real estate, according to the Emerging Trend in Real Estate report produced annually by the Urban Land Institute and PwC. And it seems that both price growth and the general stability of Germany’s cities haves attracted foreign investors in recent years, according to Bianca Passlack, a senior marketing analyst at Jones Lang LaSalle Residential Development in Berlin.

More: Is It the Right Time to Invest in Luxury Real Estate?

However, Mr. Veraguth believes the long-term perspective is mixed.

Although home prices are still rising, price growth rates probably reached their peak in early 2015 and have been getting progressively weaker since then, according to a UBS report on the country co-authored by Mr. Veraguth. So while house prices still have room to grow, it’s likely they will do so at a slower pace and investors should be selective at this stage of the cycle. Economic conditions in Germany area are strong, but the landscape is "altering fast" and its liabilities within the Eurozone could make for changes in the country’s economy.

Mr. Veraguth also pointed out that it is now "quite late" in the prolonged housing real estate cycle in Germany, which began in 2008 and gained more steam in 2010.

"Entering the market now is not attractive for a short investment period of less than 10 years," he said.

More: The Four Pillars of Foreign Investment

Price Surge in 2017

For the moment, German cities are performing well. Berlin led Knight Frank’s Global Residential Cities Index for 2017, registering a 20.5% year-over-year growth in housing prices. Three other German cities broke the top 10: Hamburg and Munich took the seventh and eighth slots on the list, up 14.1% and 13.8% from the year before, respectively, and Frankfurt was in the 10th spot with a 13.4% increase.

It was the first time any of the German cities have made the list, which tracks the entire housing market, since it was launched in 2015, according to Knight Frank. That’s because the country has been "quite lacking in transparency in terms of the property market," said Kate Everett-Allen, a partner in charge of residential research at Knight Frank and the author of the report.

Sales of luxury homes have been better recorded, which in recent years has landed Berlin near the top of Knight Frank’s Prime Global Cities Index, which includes just homes priced in the top 5% of the market, Ms. Everett-Allen said. The German capital ranks fourth in the latest index for the first quarter of 2018, with a 10.9% year-over-year price growth.

More: German Cities Among the World’s Fastest-Growing Housing Markets

"Berlin has evolved into a safe haven for global investors," she said.

Ms. Everett-Allen cites the city’s competitively priced prime residential market, compared to other gateway cities in Europe, as one of the city’s appeals. And for those looking to rent out their property: the low home-ownership rate, only about 15%, and strong tenant demand are additional attractions.

Dearth of New Developments

Development, however, has not kept pace with the demand.

"There’s an expanding demand and a shrinking supply," Ms. Everett-Allen said, adding that she expects price growth to stay consistent for the next few years.

According to a May report by German brokerage Engel & Völkers, the average sale price for a freehold apartment in Berlin was up more than 13% in 2017. And the biggest growth was in some of the city's priciest neighborhoods, with average prices in Prenzlauer Berg up 16% in 2017 to €338,000 (US$401,020); Wilmersdorf reaching €401,400 (US$476,114), an 11% gain; and apartments in Zehlendorf now costing about €367,300 (US$435,667), a 10% gain. Mitte, where prices rose 2% in 2017, is Berlin's most expensive neighborhood, the report said.

More: Berlin’s Apartment Market Zooms Ahead

On the supply side, Berlin has shown reluctance when it comes to development. The government has introduced rent caps to keep speculation at bay, as well as several other measures that could impede developers.

"Neighborhood protection zones, pre-emptive public sector purchasing rights, urban construction contracts—all these and many more are making the purchase of properties in the capital more difficult," Michael Voigtländer, who heads of the research unit for financial and real estate markets at the Cologne Institutefor Economic Research, wrote in the 2017/2018 Condominium Report Berlin, also produced by Knight Frank.

Mr. Voigtländer suggested that building restrictions might be the biggest obstacle for large investors, "but still, the long-term investor will outlive political cycles."

From Penta: Luxury Fashion Brands Push Into Hotel Space

Other German Cities Also Flourishing

Berlin is not the only city in the spotlight. Frankfurt was the highest scoring city on Knight Frank’s Prime Global Cities Index, with a fourth place ranking and 12.9% growth. An increased demand and subdued supply are factors in price growth there as well, according to Ms. Everett-Allen.

Frankfurt is Germany’s financial capital,with more than 250 banks, Ms. Passlack noted, adding that it is becoming "a more preferred location especially for financial institutions nowadays due to the Brexit effect." It also has one of the country’s largest airports, and a very low vacancy rate.

Hamburg, the port of Germany, "is rocking the market," according to Ms. Passlack. The city’s architecture and arts scene, including the new Herzog and de Meuron-designed concert hall, the Elbphilharmonie, are some of the reasons for its appeal, she said. Munich has always been a high-performing city, and had a vacancy rate of close to 0%, she added.

More: Frankfurt’s Westend, Popular Amongst Bankers, Offers Historic and New Homes Alike

Clock Might Be Ticking on Price Increases

Although the current climate in Germany is strong, some say it can’t last.

The ZIA German Property Federation, a Berlin-based professional association and the regulatory-policy and economic-policy interest group for Germany’s real estate industry, is predicting prices will level out soon. In its spring report, ZIA said pricing has been inflated by as much as 30%, and that the trend will not continue. A correction will be seen in places like Munich and Berlin, according to the report, and prices could drop "by somewhere between a quarter or a third in real money terms." Its outlook for Hamburg is mixed, as it is for Frankfurt, as "the ramifications of the Brexit will play a key role."

The report suggests looking "beyond Germany’s metropolises" to the country’s mid-size cities, which also offer chances for profitable real estate investments.

More: Click for More In-Depth Analysis of Luxury Lifestyle News

"With their high-net initial yields and their strong demand for new construction in the segment of multi-family dwellings, the cities of Flensburg and Fulda stand out as particularly interesting investment destinations," the report said. Flensburg is in northern Germany, close to its border with Denmark and about 438 kilometers (272 miles) from Berlin, while Fulda is in central Germany, about 463 kilometers (288 miles) to the capital.

In the case of a global economic crisis, experts agree that Germany is likely to weather the storm better than most countries.

"Germany has a comparatively good chance to recover [from a global economic crisis] due to its relative strong competitiveness, which in turn protect real estate value in the long term," Mr. Veraguth said.