Companies across Germany have quietly rekindled once-strong commercial ties with Iran, industry officials said. The shift, also occurring in other European countries, is possible because Western governments—working to prevent Iran from developing nuclear weapons—in November granted it some relief from sanctions. Talks on a broader deal continue, sparking hope among some businesses that Iran’s market of 77 million potential consumers could soon open to them.

“The market will explode when the embargo gets lifted,” predicted Stephanie Spinner-König, managing director of high-tech component maker Spinner GmbH and a participant in one of two German business delegations that visited Iran this year.

While German companies see opportunities in Iran, few want to discuss it publicly. Many fear talking up the pariah country could damage close relations with the U.S. America was Germany’s second-biggest trading partner last year and Iran ranked only 55th. U.S. companies have avoided Iran since the U.S. cut off ties during the Islamic revolution there in 1979.

Relations with Russia show the delicate situation for Germany businesses, which are some of the world’s strongest exporters. Over recent decades, trade between the two countries boomed, reaching $100 billion last year. Roughly 300,000 German jobs depend directly on Russian exports, according to the German Chamber of Industry and Commerce, known as DIHK.

When Western governments lashed out at Russian President Vladimir Putin in March following Russia’s annexation of Crimea from Ukraine, German companies initially opposed sanctions. Their reaction drew condemnation from other Western countries, although Germans largely supported a continuation of business relations.

Only after Russia was implicated in the shooting down of Malaysia Airlines 3786.KU +6.82% Flight 17 on July 17, which killed 298 people, did German businesses start distancing themselves from Russia. German industrial officials have endorsed a new round of European and U.S. sanctions imposed last week.

The latest came from Daimler AG Chief Executive Dieter Zetsche. “Peace and stability and every measure that contributes to that has priority over everything else,” he was quoted in Sunday newspaper Bild am Sonntag.

Some German companies are also cautious in Iran after running afoul of past Middle East sanctions. In 2007, dozens of German firms were linked to bribes and kickbacks in Iraq’s United Nations-sanctioned oil-for-food program in the 1990s.

And even companies venturing back to Iran face big hurdles on simple transactions. The country remains largely cut off from international banking, for example.

Still, Iran’s draw is strong. As recently as 2005 it imported €4.4 billion ($5.9 billion) in German goods.

“Iran is a big potential market for us, similar only to Turkey,” said Volker Treier, head of international trade at the DIHK. But before companies air their plans for Iran, “they must be certain that things will get going there.”

If Western companies are allowed back into Iran, German firms stand well positioned. Before the U.N. Security Council imposed sanctions in 2006, German giants including auto maker Daimler and drug maker Bayer AG BAYN.XE -0.25% were big players there. Industrial conglomerate Siemens AG SIE.XE +0.59% entered Iran in 1868 while building Britain’s telegraph line between London and India.

When the U.N. embargo deepened in 2010 and 2012 due to concerns over Iran’s nuclear program, most big German companies withdrew or shunned new deals.

Now they’re being pulled back by possibilities of a young, educated population hungry for consumer goods and manufactured products. Iran’s huge oil and gas reserves are another big draw. DIHK estimates German exports to Iran could quickly top €10 billion annually if sanctions are relaxed, from €1.85 billion last year.

Around 100 German companies have branches in Iran and more than 1,000 businesses work through sales agents, according to the German-Iranian Chamber of Industry and Commerce. Many want information after Iran’s years of isolation.

A two-day July conference on Iran in Frankfurt drew 40 companies from the machine and factory-engineering industries. Topics included market entry options, investment rules, sanctions and Iranian politics.

“Companies are already trying to sign letters of intent with Iranian trading partners to get a foot in the market,” said Juliane Emami, project manager at conference organizer Management Circle AG.

Daniel Bernbeck, head of the German-Iranian chamber in Tehran, said requests from companies in Germany for information and Iranian contacts has more than doubled from that of recent years, to around 20 queries a day. “Germany’s fundamental interest in this well known and big market has clearly increased,” he said.

Ms. Spinner-König of Spinner exemplifies the first wave. Her company generated less than €100,000 in sales from Iran last year, a fraction of its €80 million in revenue.

“Iran is certainly not our biggest export market, but it’s clear that they have a big investment backlog and that a lot more is possible,” she said.

Some industrial giants such as automotive parts producer Bosch GmbH, which signed its first contract. are already venturing back.

“We’ve already signed our first contracts,” said spokeswoman Trix Böhne. “But this is all at very early stages and we will have to see how things develop.”