But enough sanctions remained that Western banks refused to finance commerce with Iran without specific licenses from the United States Treasury. That seemed to choke off most business opportunities outside the oil and gas sector and the airlines. But for whatever reasons, AT&T decided to move ahead, apparently determined to shun publicity about its moves.

It remains unclear how AT&T and RighTel will settle accounts. A representative for AT&T said the company would not disclose information on financial arrangements made with the Treasury or with its Iranian partner. One possible clue: RighTel is owned by the Social Security Organization of Iran, a state entity that has large stakes in several domestic banks.

The Treasury would also not speak about the deal, saying in a statement that it “generally does not comment on specific licenses or engagement with private parties.”

Nevertheless, having working American mobile phones in Iran sends a powerful message that times are changing, albeit very slowly.

“Now we are, of course, hoping that the United States lifts all trade restrictions on Iran,” Mr. Daneshmand said. “In return, we will lift visa restrictions for Americans.”

In the past, Iranian interest in AT&T was of a different nature. In 2011, Iranian hackers targeted the carrier along with several other companies, dozens of banks and even a small dam in a suburb of New York, the Justice Department wrote in a complaint this year. Seven Iranian computer specialists who regularly worked for the Islamic Revolutionary Guards Corps were accused of carrying out the attacks.

AT&T still faces the many hurdles that all companies have in doing business in Iran. In addition to its endemic corruption and bureaucratic inefficiency, Iran works on a calendar different from the West’s, with different months and a Thursday-Friday weekend. The communication infrastructure is poor but improving, and many websites are blocked by the government.