MOSCOW — Ukraine has opened a criminal investigation into allies of President Trump, following reports that they had the United States ambassador under surveillance while she was stationed in Kyiv, the Ukrainian government said on Thursday.

The move was a remarkable departure from past practice for the new government of President Volodymyr Zelensky, which has tried hard to avoid any hint of partisanship in its dealings with Washington.

The current situation has heightened those sensitivities, with Ukraine caught in the middle of the conflict between Democrats and Republicans over the impeachment of Mr. Trump for his pressure campaign on Ukraine.

But the recent release of documents in Washington has prompted a change of course. On Tuesday, just before Mr. Trump’s impeachment trial in the Senate was scheduled to begin, Democrats in the House of Representatives published text messages to and from Lev Parnas — an associate of Rudolph W. Giuliani, the president’s personal lawyer — pointing to surveillance of the ambassador, Marie L. Yovanovitch.