On a Friday in late July, Rudy Giuliani boarded a plane to Spain to meet with an adviser to the Ukrainian president about a plan to investigate Joe Biden.

The trip was described in a whistleblower’s complaint. Several former Giuliani colleagues said they believe it should appear in a future indictment.

Giuliani’s role in the scandal that has triggered an impeachment inquiry is still coming into focus. But several legal experts who used to work with the former U.S. attorney-turned New York City mayor-turned chief President Donald Trump defender told NBC News they believe his conduct likely broke the law.

"This is certainly not the Giuliani that I know," said Jeffrey Harris, who worked as Giuliani’s top assistant when he was at the Justice Department in the President Ronald Reagan administration. "I think the Giuliani that I know would prosecute the Giuliani of today."

Harris and the other former Justice Department lawyers said they believe Giuliani has potentially exposed himself to a range of offenses — from breaking federal election laws to bribery to extortion — through his efforts to assist the Ukrainians in probing Biden, Trump’s top political opponent.

NBC News reached out to seven former colleagues of Giuliani's. Of the six who offered comments on or off the record, none defended him.

Download the NBC News app for full coverage of the impeachment inquiry

At the heart of the whistleblower's complaint is the allegation that Trump abused his power by soliciting "interference from a foreign country" in the 2020 elections — with Giuliani acting as the president’s point person in the effort.

"There’s a whole apparatus of the United States government that’s set up to deal with foreign officials and Rudy Giuliani’s not one of them," said Harris, now a lawyer in private practice in Washington D.C.

"To the extent that you could look at this as using government resources for your benefit, there are a number of crimes that this conduct would answer to."

Giuliani’s trip to Spain came one day after Trump urged Ukraine President Volodymyr Zelenskiy to probe Biden and his son Hunter, according to the whistleblower's complaint.

The president has been pushing the claim that Biden helped to force out a Ukrainian prosecutor because the man was probing a gas company that employed Hunter Biden as a consultant. The prosecutor was ousted amid calls from top officials of several Western nations over concerns he wasn’t doing enough to root out deep-seated corruption.

In addition to his trip in Spain, the whistleblower's complaint says, Giuliani had other contacts with Ukrainian officials as part of the effort to dig up dirt on Biden. Giuliani met with Ukraine’s prosecutor general on at least two occasions — in New York in January and in Warsaw, Poland in February, according to the complaint.

Bruce Fein, who worked at the Justice Department with Giuliani in the early 1980s, said he believes Giuliani could be prosecuted for breaking federal election laws.

"He was soliciting a foreign government to help Trump’s 2020 campaign. That’s a problem," said Fein, a former special assistant to the assistant attorney general for the Office of Legal Counsel under President Richard Nixon and associate deputy attorney general under President Ronald Reagan.

"Federal election laws make it illegal to solicit anything of value from a foreign government or persons to influence the outcome of an election."

Fein said Giuliani could also have opened himself up to bribery charges in connection with the president allegedly withholding military funds in order to pressure the Ukraine to launch an investigation of the Bidens.

"If Giuliani was privy to that, he could be complicit with Trump in conspiring to solicit a bribe," Fein said.

Giuliani, who has said he’s been working as an unpaid attorney for Trump, has told NBC News that he went to Spain on his own dime on a trip he described as a mix of business and pleasure. Giuliani is not listed as receiving any money from the Trump campaign, according to FEC filings.

President-elect Donald Trump and Rudy Giuliani shake hands following a meeting at Trump International Golf Club in Bedminster, N.J., on Nov. 20, 2016. Drew Angerer / Getty Images file

Reached for comment on Friday night, Giuliani scoffed at the suggestion that he had broken the law.

"Bulls--t," Giuliani texted. "They don’t know what they are talking about. What crimes."

Giuliani followed up with a phone call in which he used colorful language to defend his actions and attack his former colleagues.

He said he could not have committed bribery because he didn’t offer the Ukrainians anything of value. "Are these guys lawyers or are they morons?" Giuliani said.

Giuliani also pushed back against the claims that he tried to pressure the Ukrainians or influence the upcoming presidential election.

"I did not threaten them. I didn’t tell them what to do," Giuliani told NBC News. "I recommended that it would be a good thing to complete the investigations."

He added: "I wasn’t going there to affect the 2020 elections. I was going there to clear my client. It’s totally absurd."

Joseph diGenova, who was U.S. Attorney for the District of Columbia during Giuliani’s tenure as top prosecutor in New York, has publicly defended his former colleague, notably during his appearances on Fox News, where he is a contributor. DiGenova and his wife Victoria Toensing have also assisted Giuliani in his research on the Bidens and Ukraine, according to multiple media accounts.

Daniel Richman, who worked under Giuliani in the U.S. Attorney’s Office in Manhattan in the late 1980s, said he needed to see more evidence before making a conclusive determination. But he agreed that an effort to assist in a plot to withhold funds from a foreign power in exchange for a personal or political favor could expose Giuliani to criminal charges.

"An effort to use congressionally allocated funds as a club to extract a personal benefit could easily fit within some combination of fraud, extortion, and perhaps bribery statutes," said Richman, now a professor at Columbia Law School.

Other former prosecutors who worked with Giuliani raised the issue of him seemingly conducting American foreign policy in apparent violation of the Logan Act, which bars private citizens from negotiating with a foreign government on behalf of the U.S.

But no one has been convicted under the law, which dates back to 1799, and a potential case would likely be complicated by the fact that Giuliani was authorized by the president, the ex-prosecutors said.

"I’m of the view that this is probably less criminal than it is outrageous," said a former prosecutor who requested anonymity because he didn’t want to be seen as publicly criticizing his one-time colleague.

Former federal prosecutor John Flannery, who worked with Giuliani in the mid-1970s, said he was taken aback by what he described as Giuliani’s flagrant abuse of the law.

"He’s put himself in a position of aiding and abetting, and perhaps initiating, an exchange of favors with a foreign government for an American political campaign at the behest of the candidate himself," Flannery said. "Neither of them deny it, and in fact they’re profusely, repeatedly, painfully, admitting to it."

Flannery said the Giuliani of today is nothing like the man he worked with some 40 years ago. "He’s a shadow of the best Rudy he was, and he's not the great lawyer I thought he’d be," said Flannery.

While many of the former prosecutors interviewed by NBC News expressed skepticism that the Justice Department would ever charge Giuliani, Flannery said he wasn’t so sure.

"Right now, it seems like we’re looking at a system where crimes we believed to have happened will not be prosecuted." Flannery said. "But history teaches us that can turn around as quickly as the impeachment inquiry did this week."

Editor's Note: This story has been updated to provide more detail on Joseph diGenova’s relationship to Rudolph Giuliani and his work.