CARACAS, Venezuela — The last remaining American diplomats in Venezuela left the country on Thursday, amid deteriorating ties between Washington and Venezuelan President Nicolas Maduro.

“I know it is a difficult moment for them,” U.S. Secretary of State Mike Pompeo said of the departing diplomats. He said they would continue to carry on their “mission from other locations, where they will continue to help manage the flow of humanitarian assistance to the Venezuelan people.”

He said the U.S. remains committed to supporting opposition leader Juan Guaido, who has declared himself interim president and is trying to oust Maduro and hold what he says would be free and fair elections. “We look forward to resuming our presence once the transition to democracy begins,” Pompeo said in a statement.

A convoy was seen leaving the U.S. Embassy in Caracas on Thursday morning, and the American flag was no longer flying outside the embassy. The diplomats left the country on a chartered civilian aircraft.

James Story, who was the top-ranking U.S. diplomat in Venezuela, said in a video message that most Venezuelans don’t support Maduro and that the government had used “the threat of armed gangs” against its people.

“How can they talk about democracy when they systematically violate the constitution, disable political parties, imprison opposition leaders and persecute anyone who dares to raise their voice in opposition?” Story said.

Earlier this week, Maduro praised Story for his professional conduct. However, the Venezuelan government had described the remaining American diplomats as a threat to the country’s peace and stability.

Meanwhile, businesses re-opened and public transportation resumed in parts of Venezuela where power has been restored, ending nearly a week of the country’s worst blackouts. Information Minister Jorge Rodriguez said schools will re-open on Monday. The government says the national power grid is functioning well and that running water has returned to most of the country, though some areas reported continuing problems.

Some neighborhoods in the northwestern city of Maracaibo, where massive looting occurred during the outages, still didn’t have power. The subway began operating in the capital, Caracas, though not all of its stations were open.

WATCH: Venezuela’s political battle over foreign aid turns to violent confrontation

Maduro blamed the blackouts on alleged sabotage engineered by the U.S. and the Venezuelan opposition. U.S. officials and Guaido said the allegation is absurd and that government corruption and mismanagement caused the infrastructure collapse in a country already suffering hyperinflation and shortages of basic goods.

Pompeo tweeted earlier in the week that the U.S. diplomats were being withdrawn because their continued presence in Caracas had become a “constraint” on U.S. policy. He did not clarify what he meant by that remark.

The Venezuelan government disputed Pompeo’s account, saying it had instructed the U.S. diplomats to leave.

Maduro accuses Guaido and the United States of plotting an invasion. The United States has imposed sanctions on Venezuela’s oil industry as well as individuals linked to Maduro’s government, and U.S. President Donald Trump has said “all options are on the table” in his administration’s support for Guaido.

Also Thursday, Russia’s Gazprombank said it was pulling out of a joint venture with PDVSA, Venezuela’s state oil company, Russian state media reported. Russia is an ally of Maduro, but its oil interests in Venezuela have been jeopardized since the Trump administration hit PDVSA with sanctions in January.

WATCH: Why Venezuela’s Chavistas are fiercely loyal to Maduro, despite economic crisis

More than 600 visas have been revoked since late 2018 as part of U.S. efforts to pressure Maduro’s government, State Department spokesman Robert Palladino said. Since Monday, the U.S. has revoked 340 visas, 107 of which were for Venezuelan diplomats and their families, according to Palladino.

Maduro’s government in January cut ties with the U.S. over its recognition of Guaido as Venezuela’s rightful leader, a stand taken by about 50 other countries that contend Maduro’s re-election last year was rigged and that he has no legitimacy. Venezuela later allowed a skeletal staff to remain at the hilltop U.S. Embassy until Thursday’s withdrawal.

Associated Press writer Matthew Lee in Washington and Vladimir Isachenkov in Moscow contributed.