Alistair Young / (CC BY 2.0) Berlin beats London (in tech) “What we’re seeing now is the outcome of Berlin’s first baby steps.”

BERLIN — The €2.8 billion sale last week of Nokia’s mapping business to a group of German car makers was a return home of sorts. The division was founded in Berlin and helped spark a startup scene that now threatens to unseat London.

The division, called Here, began life as Berlin-navigation outfit Gate5. The co-founder, Christophe Maire, has since become a local angel investor and serial entrepreneur.

Meanwhile, Felix Petersen, whose Amen app epitomized the peak of the Berlin hype a few years ago, also gained prominence by selling his Plazes “geo-social networking” app to Nokia in 2008. Plazes was also absorbed into Here.

The knock-on effect: Eric Wahlforss, who got his start by programming at Gate5, co-founded SoundCloud in Berlin with early money from Maire and Petersen.

That’s how startup ecosystems are born.

The alchemy of creating a breeding ground for innovation and growth is tricky. Germany has juggled with the balance of government incentives and tax breaks, while drawing talent from abroad and fostering the infectious spirit of incubators.

“The booming startup scene is one of the driving forces behind Berlin’s recent economic success story,” says Cornelia Yzer, Berlin’s senator for economics, technology and research.

Berlin startups raised about €2 billion in venture capital in 2014, putting it above London (with €1.4 billion for 2014) for the second year in a row. In the first half of this year, the jostling capitals were neck-and-neck at around €1.2 billion each, according to Dow Jones VentureSource.

One out of eight new jobs in the city is now generated in the digital economy, according to the state senate. More than 500 new tech companies start up in Berlin each year. A total of 62,400 people work in the sector, accounting for 3.5 percent of Berlin’s workforce. The digital sector accounts for 4.2 percent of Berlin’s gross domestic product, or €3.9 billion annually.

The city has never had trouble attracting digital workers. First they came from Eastern Europe and Scandinavia, but more recently also from countries such as Spain, Italy, France and the U.K.

Because of its isolation during the Cold War and the fact that West Berliners were exempted from the military draft, the city has long been a magnet for artists and counter-culture types. It’s a cheap place to live and work (though less so), and offers a vibrant nightlife for young techies.

Case in point: Chad Fowler quit his job in Washington, where he was vice president of technology for LivingSocial, a marketplace for social activities. He was tempted by a headhunter’s email in 2013 with the simple subject line: “Chief technology officer, Berlin.”

One out of eight new jobs in Berlin is generated in the digital economy.

“The idea of living here just sparked my imagination in a way I didn’t expect,” said Fowler, who got the job at Wunderlist, the task-management app acquired by Microsoft in June.

“When I hire people from the U.S., Berlin is often an attractive factor — it’s important that we propagate this fantasy about there being this flourishing second Silicon Valley.”

While the scene indeed flourished, it was mostly self-nourished. Local authorities provided little in the way of encouragement, at first. The city was broke.

“Poor but sexy,” former Mayor Klaus Wowereit memorably put it.

Around the start of this decade, the combination of Berlin’s attractive lifestyle and those early successes began to pay off.

“It was a very small scene, and the hype really exploded by the end of 2011, first half of 2012,” said David Knight, a prominent blogger who hosts regular meetups called “Silicon Allee.”

Of course, for all the shooting stars, plenty become financial black holes.

There was a lot of hype around trendy-but-brief companies like Gidsy, which claimed to be an “Airbnb for activities,” and Amen, an app that let people rate anything with a thumbs-up or thumbs-down.

Both Gidsy and Amen were backed by Hollywood actor Ashton Kutcher. That sprinkled some stardust, but neither company attracted enough users. Both failed in 2013 and were sold to other Berlin startups.

More worrying for investors — few local IPOs have taken flight.

German Startups Group, a venture capital group, delayed its own stock debut last month because investors were wary after the IPOs of Rocket Internet, down 22 percent since October 2014, and baby products e-commerce outfit Windeln.de, off 32 percent since May 2015.

Delivery Hero, a food-ordering operation that claims a valuation of almost €3 billion, is cautiously talking about an IPO sometime after this year.

“You had [a few hyped] startups and all of a sudden all them were contenders to be the next billion-dollar company. They failed because they were startups. Out of three to four hundred, they failed,”said Ciaran O’Leary, a venture capitalist at Berlin-based investment firm Earlybird.

Fueling the eternal dot-com dream, other consumer-oriented startups survived and continued to expand, including SoundCloud, EyeEm, a photo-sharing service, and Wooga, a gaming company. Microsoft founder Bill Gates even backed ResearchGate, an academic social network.

The Samwer brothers’ Rocket Internet gained notoriety as a clone factory, copying U.S. online business models and deploying them around the world before the original companies could blink.

Rocket’s highly aggressive, but effective, tactics were initially confined to e-commerce. Then they took on other areas like financial technology.

While Rocket’s stock may still be gamble, the company has become a breeding ground for young entrepreneurs, skilled in the arts of execution and cross-border expansion.

Berlin’s officials and corporates have started paying more attention.

Berlin’s startups are also being turbocharged by “accelerator” programs, many of them sponsored by large corporations such as Deutsche Telekom, Microsoft and Axel Springer (the German media company owns 50 percent of POLITICO's Europe edition).

“The corporates began to realize the importance of the startup scene in Berlin, whether from a slightly cynical ‘We want to be cool’ kind of way, or [by thinking] ‘This is where we’re going to find our own innovation in the future’,” says Knight, the blogger.

What’s more, there have been some stellar IPOs, including Rocket spinoff Zalando, a fashion retailer that began life as a Zappos clone. The stock is up 50 percent since its debut last October.

Berlin officials, too, have started paying more attention. Taxpayer-funded investment pots were boosted to €100 million for the 2014-2020 period, up from €82 million from 2007-2013. Every public euro attracts at least six from private investors, according to the senate.

The senate is also trying to block German Finance Minister Wolfgang Schäuble’s plans to slash tax breaks for angel investors who sell their shares in startups. The officials don’t want Berlin’s tech hopefuls to be at a disadvantage to other European capitals (read: arch-rival London) that offer tax breaks.

There have been some big-name exits by sale, but price tags are seldom disclosed. Panasonic Automotive bought music-streamer Aupeo in 2013, for example. Microsoft, meanwhile, paid a reported $100 million to $200 million for 6Wunderkinder in June — modest by Silicon Valley standards, though a good result for the Berlin scene.

“You’re seeing the very first wave of Berlin startups — and it takes six to 10 years from a wave starting to being successful — having their payday,” said O’Leary, the venture capitalist. “What we’re seeing now is the outcome of Berlin’s first baby steps.”