(CNN) Two associates of Rudy Giuliani connected to efforts to dig up dirt in Ukraine on Democratic presidential candidate Joe Biden were arrested trying to leave the country and indicted on criminal charges for allegedly funneling foreign money into US elections.

The charges against the men suggest Giuliani's push on Ukraine and President Donald Trump's receptiveness to it had ties to an illegal effort to influence US politics and policy using foreign funds. The indictment involves two people central to the impeachment inquiry in the House.

The two Giuliani-linked defendants, Igor Fruman and Lev Parnas, were detained at Dulles International Airport outside Washington on Wednesday evening. They were booked on a flight to Frankfurt, Germany, to connect to another flight, according to a law enforcement source.

Federal prosecutors were not intending to unseal the indictment against the Giuliani associates and two others Thursday, according to three US officials, but had to change course when they learned of the defendants' impending departure. The two were detained as they were about to board the flight with one-way tickets, Manhattan US Attorney Geoffrey Berman told reporters Thursday.

Giuliani had lunch with Fruman and Parnas at the Trump International Hotel in Washington hours before the two were arrested, The Wall Street Journal reported. Giuliani declined to comment to CNN on the report.

Attorney General William Barr, who visited the Manhattan US Attorney's office Thursday in what officials said was a routine stop, was briefed on the investigation into Parnas and Fruman in February after he took office, and he supported the prosecution, according to a US Justice Department official.

Overall, four men were indicted Thursday on two counts of conspiracy, one count of false statements to the Federal Election Commission and one count of falsification of records. The four are alleged in the indictment unsealed by New York federal prosecutors to have conducted a scheme beginning in March 2018 to evade campaign finance laws.

Fruman and Parnas appeared in court Thursday in Virginia, where prosecutors told a judge they were concerned the two might attempt to flee. They haven't entered a plea.

They will be held in detention in Virginia until they each secure $1 million bond, a judge said.

Along with Fruman and Parnas, Andrey Kukushkin was arrested and appeared in court Thursday in San Francisco, where he refused to turn over his Ukrainian passport. His bail hearing is set to resume Friday. The fourth man, David Correia, hasn't been arrested. All four are US citizens, according to the indictment.

An attorney for Parnas and Fruman, Kevin Downing, declined to comment on the indictment. An attorney for Kukushkin, Robert Finkle, didn't respond to a request for comment.

Connection to super PAC, US congressman

Parnas was Giuliani's fixer in Ukraine, introducing him to current and former officials as far back as 2018, according to CNN's reporting.

Starting in November 2018, Giuliani told CNN, Parnas and Fruman introduced him to former and current Ukrainian officials who provided information that Giuliani claims is damaging to some of Trump's political enemies, including Biden. House Democrats have subpoenaed documents from Giuliani relating to those interactions.

The request from Congress is the second set of subpoenas linking Giuliani and other Trump affiliates to Parnas. The first set, part of a lawsuit filed in federal court in Florida earlier this year, sought Parnas' financial records and included a request for any work he may have done on Giuliani's behalf.

They gave hundreds of thousands in donations to a Trump-allied super PAC, according to the Miami Herald.

Fruman and Parnas asked a US congressman, who is not named in the indictment but appears to be former Texas Rep. Pete Sessions, to help get the US ambassador to Ukraine fired at the same time that they were committing to raise tens of thousands of dollars for that congressman's reelection effort, according to the indictment. Parnas made their request to the congressman in part at the behest of one or more Ukraine government officials, the indictment states. Donations to Sessions match those laid out in the documents and he has publicly acknowledged raising criticism of the former ambassador.

Sessions, the former chairman of the powerful House Rules Committee, is not charged with any wrongdoing. In a statement, Sessions said he "could not have had" knowledge of the alleged scheme. "I was first approached by these individuals for a meeting about the strategic need for Ukraine to become energy independent," he said. "There was no request in that meeting and I took no action."

The ambassador at the time, Marie Louise Yovanovitch, was eventually recalled in May after earning the ire of Trump and other conservatives, who viewed her as biased against the President.

Yovanovitch has become one of the central figures in the ongoing impeachment effort in the House and is expected to appear before lawmakers for a deposition on Friday.

As they sought to raise a promised $20,000 for the congressman, Fruman allegedly made a donation to the lawmaker in Parnas' name to skirt limits on individual donations, in violation of campaign finance law, the indictment says.

The indictment also lays out how they donated $325,000 to a pro-Trump super PAC, America First Action, around this same time through a limited-liability company, Global Energy Producers, allegedly created for the purpose of masking the true source of their campaign contributions. That PAC spent heavily in 2018 to support Sessions, over $3 million, but he went on to lose his seat.

America First Action told CNN in a statement that it has not used the donation and that it placed the contribution from Global Energy Producers in a segregated bank account after it became the subject of a Federal Election Commission complaint and lawsuit.

"[I]t has not been used it for any purpose and the funds will remain in this segregated account until these matters are resolved," said spokeswoman Kelly Sadler. "We take our legal obligations seriously and scrupulously comply with the law and any suggestion otherwise is false."

On Thursday, Berman, the US Attorney in Manhattan, said the defendants' alleged conduct threatened the US democratic process. "Protecting the integrity of our elections and protecting our elections from unlawful foreign influence are core functions of our campaign finance laws," he said. "As this office has made clear, we will not hesitate to investigate or prosecute those who engage in criminal conduct that draws into question the integrity of our political process." He added that the investigation is ongoing.

Push for marijuana retail licenses

Part of the alleged scheme revolved around an effort to curry favor with politicians who could help them win licenses for a retail marijuana business they hoped to establish. The business venture and the ensuing lobbying effort was largely funded by a Russian national, running afoul of campaign finance violations that prohibit political donations from foreigners, the indictment states.

The Russian is not named but identified in court documents as a businessman. At one point, Kukushkin is quoted in the indictment discussing ways to hide the funder's "Russian roots" because of the "current political paranoia about it."

Parnas and Fruman, as well as the two other defendants, are said to have drafted a chart that outlined a "multi-state license strategy," planning for $1 to $2 million dollars in political donations to federal and state committees that were backed by the Russian national.

The foreign national eventually made wire transfers totaling $1 million to Fruman and another unnamed individual last year, and the defendants used those funds to make donations to a number of political candidates in Nevada that they thought could help further their plans for the marijuana business, the indictment says.

The marijuana business never actually came to fruition, according to the indictment.

Nevada politicians

Though the candidates aren't named in the indictment, one appears to be former Nevada gubernatorial candidate Adam Laxalt, according to state campaign finance data that corresponds with information in the charging papers. Trump campaigned in Nevada on October 20, 2018 for Laxalt, who was the Republican candidate for Nevada governor in the race. Laxalt lost.

A spokesman for Laxalt, Andy Matthews, said of Fruman: "He came to a Las Vegas fundraiser. Adam doesn't know the man."

Wesley Duncan, a candidate for Nevada state attorney general, also attended the October 20 rally, and appears to be the other candidate referenced in the indictment.

Duncan hasn't responded to a request for comment.

This story is breaking and will be updated.