The law firm at the center of the Panama Papers leak acted for an Iranian oil company that had been blacklisted by the U.S., the Guardian reported, citing the leaked documents. Panama-based Mossack Fonseca reportedly realized that the Iranian oil firm Petropars Ltd. was a blacklisted company only in 2010 when another client accidentally ran afoul of the U.S. sanctions imposed against the energy firm.

Mossack Fonseca had issued the same P.O. box in the British Virgin Islands for Petropars and the other client and banks had flagged that the address was linked to a blacklisted company. The incident shows the risk in giving the same address to thousands of shell companies and Mossack Fonseca’s lack of thorough checks. The firm’s managing partner Jürgen Mossack sent out an angry email over the incident, the Guardian reported.

“Everybody knows that there are United Nations sanctions against Iran, and we certainly want no business with regimes and individuals from such places! Not because of OFAC [the Office of Foreign Assets Control, the US Treasury department that deals with sanctions] but out of principle,” Mossack said in the email, according to the Guardian. The incident unfurled when the head of Mossack Fonseca’s Geneva office requested that a client be issued a new mailing address in the British Virgin Islands. The address given, P.O. box 3136 in Road Town, Tortola, was shared by thousands of shell companies, including Petropars, in the books of the law firm.

In June 2010, Petropars was placed in the list of companies facing U.S. sanctions as it was ultimately owned by Iran. Petropars reportedly played an important role in getting foreign investment for the South Pars natural gas field — the largest in the world — which lies in the Persian Gulf and is shared with Qatar. The sanctions against Petropars hoped to stop the financial support for Tehran’s nuclear and missile programs.

When Mossack Fonseca conducted checks, it found that the law firm was acting for Petropars and two other companies it held stakes in. The companies were identified in the Guardian report as Drilling Company International Limited and Venirogc Limited. Three months after Petropars was slapped with sanctions, Mossack Fonseca’s compliance team had recommended that the company resign from Petropars and “all its associated companies.” By then, OFAC had issued sanctions against Iran as a country. While Petropars was recorded as inactive in May 2011, other Iranian companies continued on the books of Mossack Fonseca.

The Guardian report also said that Mossack Fonseca continued to serve an outfit called Petrocom, which shared the same accountant in London as Petropars and its address was recorded as Sepahbod Gharani Avenue in Tehran. The relationship was reportedly managed from the British capital, where a separately owned business had the exclusive rights to market the services being provided by Mossack Fonseca.

The law firm showed a certificate of good standing stamped by the deputy governor of Virgin Islands on Sept. 14, 2010, as well as papers that approved the appointment of a new chairman and managing director to create a joint venture. The company did conduct checks and the Guardian reported that the U.K. franchise claimed the ultimate beneficial owner of the company as Mahmoud Ahmadinejad.

The Guardian report went on to say that though Ahmadinejad, the former president of Iran, was unlikely to have held shares in the joint venture, it was clear that Mossack Fonseca’s U.K. office knew it was continuing to act for state-owned companies. In June 2013, Petrocom’s parent OIIC was included in the sanctions list by the U.S., which described it as a part of a network of 37 front companies managing the commercial holdings of the Iranian leadership. The report added that OIIC was controlled by a holding company named Eiko that stood for The Execution of Imam Khomeini’s Order.

The U.S. treasury had said, according to the Guardian, in its press release at the time: “The purpose of this network is to generate and control massive, off-the-books investments, shielded from the view of the Iranian people and international regulators.” Data from December last year showed that Petrocom still remained on Mossack Fonseca’s books while a certificate of good standing was issued last April.

The law firm said, according to the Guardian: “We have never knowingly allowed the use of our companies by individuals having any relationship with North Korea, Zimbabwe, Syria and other countries or individuals sanctioned by the United States or European Union. We routinely resign from client engagements when ongoing due diligence and/or updates to sanctions lists reveals that a party to a company for which we provide services has been either convicted or listed by a sanctioning body.”

Petrocom and Petropars, both of which did not respond to requests of comments from the Guardian, were removed from the sanctions list by the U.S. in January this year, after a nuclear deal was signed with Iran.

A letter from the lawyer for Emmanuel Cohen, who runs Mossack Fonseca’s U.K. franchise, said, according to the Guardian, that he had been “in the forefront of undertaking due diligence checks over the years” and that he  takes the obligations of reporting extremely seriously and files any suspicious activity” with the National Crime Agency. The letter also said that Mossack Fonseca U.K. “was working through a professional client in the U.K. and was not responsible for any due diligence” regarding Petropars, adding that the U.K. business was not obliged to follow U.S. sanctions.