The company that publishes the National Enquirer was concerned enough that it may have acted as an agent of Saudi Arabia that it asked the Department of Justice last year whether it needed to register as a foreign lobbyist, a person with knowledge of Saudi Arabia's lobbying efforts in the United States confirms to NBC News.

Communications between the Justice Department and American Media Inc. offer the fullest picture to date of interactions between the tabloid publisher and the Saudis ahead of AMI's release last year of a fawning magazine about Saudi Arabia's young leader. Amazon CEO Jeff Bezos, who has accused AMI of blackmailing him with intimate photos, has questioned whether Saudi Arabia may have been involved, a claim the kingdom denies.

A July 2018 letter from Justice Department lawyers to AMI and posted to a government website shows that the Justice Department's National Security Division ultimately told the publisher that, based on AMI's own statements, it did not need to register. Under the Foreign Agents Registration Act, people or entities that work to advance a foreign country's political interests in the U.S. must disclose their specific activities and register as foreign lobbyists.

"Taking into account the facts stated in your submission, and limiting our evaluation only to the facts stated in your submission, we find that there is no agency relationship between [U.S. corporation] and any foreign principal," the Justice Department wrote, referring to AMI.

Although the names of the parties are redacted in the publicly released version of the letter, the timing, facts and circumstances all line up precisely with AMI's unusual publication of the magazine about Crown Prince Mohammed bin Salman and his March 2018 visit to the U.S. The person familiar with Saudi Arabia's lobbying efforts confirmed to NBC News that AMI and the Saudi government are the entities referred to in the letter, which was first disclosed Monday by The Wall Street Journal.

American Media Inc. (AMI) headquarter building in New York on Feb. 7, 2019. Jeenah Moon / Reuters

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

AMI produced the glossy magazine last year just ahead of a whirlwind tour of the U.S. by Crown Prince Mohammed, who at the time was not a household name in the U.S. The magazine was sold on newsstands for $13.99, including in many rural states, and had no advertisements, raising questions about why AMI thought it would be a money-maker for the company.

At the time, AMI said that Saudi Arabia had played no role in the production of the magazine, even when it was revealed that the Saudi Embassy in Washington had been given an advance copy of the magazine weeks before it hit newsstands.

But in its letters to the Justice Department in May and June 2018, AMI acknowledged that it had asked a Saudi adviser to submit content for the magazine, given the adviser an early draft to review and then made changes to the final version that were suggested by the Saudi adviser.

According to the Justice Department letter, government lawyers determined that AMI didn't need to register as a Saudi agent based on the company's claims that it received no foreign funding for the magazine and that it had been under no obligation to make the changes suggested by the Saudi adviser. The identity of the adviser mentioned is unclear.

AMI's potential ties to Saudi Arabia are under scrutiny after Bezos, in his Medium post accusing AMI of trying to blackmail him, raised the possibility that Saudi Arabia had been involved either in giving AMI the "intimate text messages" or in inducing AMI to target and humiliate him. Bezos specifically raised the example of AMI's pro-Saudi magazine to point out that there have long been questions about whether its reporting is influenced by "external forces."

Bezos wrote that a top AMI official had recently told him and his lawyers that AMI's CEO, David Pecker, was "apoplectic" that Bezos had launched a private investigation into how AMI got his text messages.

"For reasons still to be better understood, the Saudi angle seems to hit a particularly sensitive nerve," Bezos wrote.

Pecker, through his lawyer, has said that Saudi Arabia was not the source of the text messages obtained by The National Enquirer, though AMI has declined to identify the source.

"The clear threat from Bezos' point of view is that we're going to link you to Saudi Arabia, we're going to say that you hacked all of these texts, we're going to slander the publication as much as we can," Pecker's lawyer, Elkan Abramowitz, said Sunday on ABC"s "This Week."

Saudi Arabia, too, has pushed back on the suggestion from Bezos that it was involved in leaking his emails.

"As far as I know, flat no," Saudi State Minister Adel al-Jubeir told reporters Friday at the Saudi Embassy in Washington. Offering his own assessment of the situation, he added, "It's a soap opera."