EXCLUSIVE: Former New York City Mayor Rudy Giuliani denied allegations that he violated the Foreign Agents Registration Act, telling Fox News on Monday that federal investigators are "trying to frame" him.

Federal investigators seized electronic devices from Giuliani's New York City apartment last week after executing a search warrant as part of a federal probe into whether he violated the law by lobbying the Trump administration on behalf of Ukrainian officials in 2019.

Giuliani has served as former President Trump's personal attorney on a number of high-profile matters.

FEDS RAID RUDY GIULIANI APARTMENT IN UKRAINE INVESTIGATION

In an exclusive interview with Fox News, Giuliani described the raid on his apartment as "out of control."

"At about 6 a.m., there was a banging on my door-- a very loud banging, and outside there was a group of an endless number of FBI agents," Giuliani told Fox News.

"Usually a person who has been a former assistant U.S. attorney, a U.S. attorney, a mayor, the associate attorney general, usually they receive a subpoena -- not have their home raided," Giuliani said.

"The only lawyers they raid are lawyers for Donald Trump. I can't think of another lawyer that has been raided other than lawyers for Trump," he continued. "Trump is in a special category because he doesn't have constitutional rights."

He continued, "They showed me a warrant that sought the electronics in my apartment and purported to be about an alleged violation of the Foreign Agents Registration Act, FARA, for failure to file as a foreign agent on behalf of an unnamed Ukrainian official." Giuliani told Fox News he "never did this" and was "shocked" because he had been offering to discuss the allegations with the U.S. Attorney's Office for the Southern District of New York.

"I am a lawyer for 51 years, I formerly ran that office," Giuliani, who previously served as U.S. attorney for SDNY, told Fox News.

"I know the criminal law and I do not violate it," Giuliani went further, saying he was "very aware of FARA" and told Fox News he complied with it "completely."

"My contracts have clauses that I will not act as a foreign agent, and I wanted to show these things to the government so that they would stop their consistent illegal leaking of an investigation," Giuliani said.

ANDREW GIULIANI BLASTS FBI RAID AS 'ABSURD'

The warrant was based on suspicion that Giuliani violated FARA in lobbying on behalf of Ukraine. FARA requires individuals to notify the State Department if they are acting as a foreign agent.

Giuliani told Fox News he and his attorney contacted officials at SDNY as recently as March 4 to provide documents after reading reports of allegations about him.

"I said, 'If you have a concern, give me an opportunity to show you it is not true,'" Giuliani explained. "They never agreed and they never stopped leaking."

A spokesperson for SDNY declined to comment.

When pressed, Giuliani said "there is absolutely no one" he would be representing that could be construed as a violation of FARA.

"There is no way on earth that they could have anyone telling the truth that I was acting as a foreign agent," he said, "nor do they have any evidence that I tried to influence the government on behalf of clients."

Giuliani told Fox News that because of his work as a personal attorney for Trump, he decided "the safest thing to do" was to refer any Ukrainian clients to Victoria Toensing.

The FBI also visited Toensing, a lawyer close to Giuliani. A well-placed source familiar with the situation said Toensing turned over a phone to the FBI but agents did not search her home.

The source also told Fox News that Toensing was informed she "is not the target of the investigation."

But Giuliani claimed the investigation itself was spurred by federal investigators' "hatred of President Trump."

"They are beyond the ability to control their rational thinking or their decency, and they have a serious, serious ethical issue, driven by Trump derangement syndrome," Giuliani said.

"They are trying to frame me," Giuliani told Fox News. "They are trying to find something they can make into a crime, some technical violation, some mistake I made."

He added: "They'll take anything."

As for any next steps in the investigation, Giuliani said he was being represented by attorney Robert Costello, who also has been consulting with Alan Dershowitz.

CLICK HERE TO GET THE FOX NEWS APP

Giuliani was instrumental in Trump's push to have Ukraine investigate then-candidate Joe Biden and his son Hunter regarding energy company Burisma Holdings, for which Hunter Biden served on the board.

Giuliani associates Lev Parnas and Igor Fruman already have been charged with crimes, including campaign finance violations, for allegedly funneling foreign money to various U.S. campaigns in order to gain influence over candidates.