WASHINGTON — Text messages given to Congress show U.S. ambassadors working to persuade Ukraine to publicly commit to investigating President Donald Trump’s political opponents and explicitly linking the inquiry to whether Ukraine’s president would be granted an official White House visit.

The two ambassadors, both Trump picks, went so far as to draft language for what Ukrainian President Volodymyr Zelenskiy should say, the texts indicate. The messages, released Thursday by House Democrats conducting an impeachment inquiry, show the ambassadors coordinating with both Trump's personal attorney Rudy Giuliani and a top Zelenskiy aide.

At one point, a diplomat quoted in the texts even expresses alarm that the Trump administration is conditioning the visit and military aid on an investigation of political opponents, saying the linkage is "crazy."

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

The messages offer the fullest picture to date of how top diplomats and Giuliani sought to advance Trump’s goal of getting the Ukrainians to investigate both meddling in the 2016 election and Vice President Joe Biden’s son, Hunter.

“Heard from White House – assuming President Z convinces trump he will investigate / ‘get to the bottom of what happened’ in 2016, we will nail down date for a visit to Washington,” former U.S. special representative for Ukraine negotiations Kurt Volker wrote to the top Zelenskiy aide July 25, just before Trump spoke by phone to Zelenskiy. That phone call led a U.S. intelligence official to file a whistleblower complaint that set off a cascade of fast-moving events, ultimately leading to an impeachment inquiry into the president.

Volker resigned amid the tumult. He provided a deposition Thursday at the Capitol, which included the text messages.

Volker and U.S. Ambassador to the European Union Gordon Sondland — both political appointees — repeatedly stressed the need to get the Ukrainians to agree to the exact language that Zelenskiy would use in announcing an investigation, the texts indicate. In August, Volker proposed to Sondland that they give Zelenskiy a statement to utter at a news conference citing “alleged involvement of some Ukrainian politicians” in interference in U.S. elections.

“We intend to initiate and complete a transparent and unbiased investigation of all available facts and episodes, including those involving Burisma and the 2016 U.S. elections,” Volker and Sondland agreed that the Ukrainian president should say. Zelenskiy never did make the statement.

Kurt Volker, a former special envoy to Ukraine, leaving after a closed-door interview with House investigators as House Democrats proceed with the impeachment investigation of President Donald Trump, at the Capitol in Washington, Thursday, Oct. 3, 2019. Jose Luis Magana / AP

Burisma Holdings is a Ukrainian gas company. Hunter Biden joined its board in 2014, while his father was vice president and handling the Ukraine portfolio. Trump has made unsubstantiated allegations that the arrangement was corrupt. There is no evidence of wrongdoing by either Joe or Hunter Biden. The president has also long promoted the baseless theory that Ukraine — not Russia — was responsible for 2016 election meddling.

The texts also show a panicky top aide to Zelenskiy reaching out to Volker after the president unexpectedly halted roughly $400 million in military assistance to Ukraine, as he increased pressure on Zelenskiy to investigate. On Aug. 29, Zelenskiy aide Andrey Yermak texted Volker: “Need to talk with you.”

The efforts by Volker and Sondland to facilitate Trump’s and Giuliani’s goal of getting the Ukrainians to probe the president’s political rivals are at odds with the account in the whistleblower complaint, which the Trump administration released to Congress under pressure last week.

Although it was Volker who initially put Giuliani in touch with Yermak, the top Zelenskiy aide, the whistleblower complaint said multiple U.S. officials had been “deeply concerned” about Giuliani’s interference in U.S.-Ukraine relations. The whistleblower reported that the officials had said both Volker and Sondland “had spoken with Mr. Giuliani in an attempt to ‘contain the damage’ to U.S. national security.”

But the text messages show Volker and Sondland playing an active role in advancing Trump’s goal of forcing a Ukrainian investigation, which Democrats argue was an abuse of power by the president to advance his political interests ahead of his re-election bid.

In fact, the only U.S. official included in the text messages who pushes back is a career diplomat, William Taylor, who became the top U.S. diplomat in Ukraine after Trump pulled Ambassador Marie Yovanovitch out of her post earlier this year. Yovanovitch’s ouster has become another topic of key interest to Democratic lawmakers in their impeachment inquiry.

“Are we now saying that security assistance and WH meeting are conditioned on investigations?” Taylor wrote, using an acronym for the White House, after Trump canceled a planned meeting with Zelenskiy in Poland. A week later, he told Sondland: “As I said on the phone, I think it’s crazy to withhold security assistance for help with a political campaign.”

Sondland, several hours later, pushed back, telling Taylor that Trump “has been crystal clear, no quid pro quos of any kind.” He suggests they stop discussing the matter via text message.

House Democrats released the texts after conducting the deposition of Volker for more than eight hours behind closed doors, in which Volker provided “further evidence that there was a shadow shakedown going on,” according to Rep. Eric Swalwell, D-Calif., who attended the deposition. The House committees said the texts were just a subset of more materials they hope to make public.

Sondland and Volker have not responded to requests for comment. The State Department did not comment on the text messages or Volker’s deposition.

“The whole investigation is crumbling,” Trump told reporters as he departed the White House on Thursday for a trip to Florida. He said his phone call with Zelenskiy had been “absolutely perfect.”

The new details on how Trump’s pressure campaign on Ukraine unfolded came as the president called for another foreign country — China — to probe his top political opponent. This time, he did it in public. Trump’s statement that “China should start an investigation into the Bidens” came as the president is engaged in a high-stakes trade war with China and added further fuel to Democrats’ impeachment push.

“This is not normal or acceptable. It is unethical, unpatriotic and wrong,” the Democratic chairmen of the House Intelligence, Foreign Affairs and Oversight committees wrote in a letter accompanying the text messages. “Engaging in these stunning abuses in broad daylight does not absolve President Trump of his wrongdoings — or his grave offenses against the Constitution.”