The battle between the popular Russian messaging service Telegram and the country's Federal Security Service (FSB) is escalating. On Tuesday Roskomnadzor, the state regulatory agency for telecommunications, threatened to block Telegram within the next 15 days should the company stand by its refusal to provide the domestic intelligence agency FSB with its encryption keys.

The warning came less than one hour after the Russian Supreme Court dismissed a case brought by Telegram. The messaging service had lodged its complaint to challenge a 2016 FSB directive calling for the disclosure of the digital company's encryption keys.

Read more: Russia tightens Internet controls, makes it easier to spy on citizens, critics say

Privacy violation or upholding the constitution?

Telegram saw the directive as a violation of privacy of correspondence and therefore took its case to the Supreme Court. During the trial, an FSB representative claimed that constitutional guarantees regarding citizen's rights were in no way affected. The "content of communications," the FSB said, would not be exposed as a result of providing encryption keys. The official justification for obtaining the keys, according to the intelligence service, is to use them to help combat terrorism.

The FSB is Russia's domestic security intelligence agency

Last fall a Moscow court fined Telegram roughly €11,500 ($14,000) over its refusal to abide by the FSB decree. Another court upheld the decision in December. Should the legal battle continue to escalate, the messaging service could be blocked in Russia. This July will be a critical point in the fight. That is when a controversial legislative package will go into full effect. Among other things, the package requires all messaging services operating in Russia to provide information about customers and their communication —including its content — to the FSB.

Read more: German federal police use Trojan virus to evade phone encryption

Born in Russia, based in Dubai?

Among those who developed Telegram in 2013 was Pavel Durov, whom media outlets like to compare to Facebook founder Mark Zuckerberg. The now 33-year-old programmer and billionaire from St. Petersburg worked with his brother Nikolai to also develop VKontakte, the Russian version of Facebook often known simply as VK. Telegram's founders claim the service is anonymous and unusually secure against eavesdropping. They say it would be impossible to provide FSB with encryption keys because these are generated on user devices and are extremely difficult to crack.

Durov himself claims he left Russia in 2014 and has lived abroad since then. The exact location of the company's headquarters remains unknown. It was long speculated that the company was based in Berlin, but German authorities have note yet confirmed that assumption. Telegram's developers recently said they had moved their base of operations to Dubai.

Pavel Durov spoke in Munich at a digital design conference in 2012

Iran as primary market

As of March Telegram had registered nearly 200 million users worldwide. In Russia, some 10 million customers use the service each month, and the numbers are growing. It appears that Telegram is poised to overtake WhatsApp and other foreign messaging services in Russia. Growing numbers of Russian politicians, journalists and administrators have shown a preference for Telegram, and Russia's Central Election Commission made use of the service during this weekend's presidential election.

Outside Russia, Iran is Telegram's number-one market. Some 40 million Iranian customers use the service each month — half of the Islamic Republic's population. Iranian authorities temporarily blocked the service at the height of last year's opposition protests. Telegram was not allowed to resume service in Iran until early 2018.