WASHINGTON — President Donald Trump sent a "confusing" message to Libya when he recently praised a military strongman waging war on the country's internationally recognized government, the Libyan deputy prime minister told NBC News.

Ahmed Omar Maiteeg said the president's phone call in April with Khalifa Haftar — a renegade general whose militia forces are pressing an offensive on the capital, Tripoli — and the White House statement that followed it took his government by surprise.

"The phone call from Gen. Haftar to President Trump was confusing to us. Because we see the U.S. govt as a our main ally," Maiteeg said in an interview with NBC News. It was the first time Libya had encountered such a "confused message" from a country it counted on as a reliable partner, he said.

But Maiteeg said he was hopeful that the United States would stick by the U.N.-recognized government and he came away encouraged from discussions with State Department officials during a U.S. visit this week.

"I am really happy about what I have heard from the State Department," he said. "The State Department understands the position of our government and the situation in Libya quite well."

Maiteeg was due to meet lawmakers as well during his trip to Washington to ensure continued American backing for his government, known as the Government of National Accord, which was installed by the United Nations in 2016.

"We don't need U.S. support with money or troops on the ground. ... We need the U.S. supporting us diplomatically and politically," he said.

After Trump's phone call with Haftar in April, the White House said in a statement that the president "recognized Field Marshal Haftar's significant role in fighting terrorism and securing Libya's oil resources, and the two discussed a shared vision for Libya's transition to a stable, democratic political system."

The scheduled phone call, which took place April 15 but was not publicly acknowledged until April 19, followed a meeting between Trump and Egyptian President Abdel Fattah al-Sisi and a conversation with the crown prince of Abu Dhabi in the United Arab Emirates, Mohammed bin Zayed, who are both staunch supporters of Haftar.

Acting Defense Secretary Patrick Shanahan later appeared to qualify the U.S. stance on Haftar, saying a "military solution is not what Libya needs."

"What we've said before and what I do support is Field Marshal Haftar's support in terms of his role in counterterrorism, but where we need Field Marshal Haftar's support is in building democratic stability there in the region," he said.

The White House did not immediately respond to a request for comment.

Maiteeg's government is locked in a civil war with Haftar's militia forces, which enjoy the backing of the United Arab Emirates, Egypt, Russia and other powers. Just days before the United Nations was preparing to hold a national conference to broker peace talks and plan elections, Haftar unleashed an attack on Tripoli, hoping to seize the city.

Maiteeg said he wanted to press home the message that Haftar had no chance of prevailing on the battlefield, as his military offensive on Tripoli has bogged down since it was launched in April.

"After 62 days of fighting, people know Haftar cannot take the city," he said.

The only solution was to pursue talks and to agree on arrangements for elections, according to Maiteeg.

The Libyan official's visit to Washington came after four senators, two Republicans and two Democrats, wrote a letter to Trump last week expressing grave concern over the role of Haftar and his assault on Tripoli.

Fayez al-Sarraj, prime minister of Libya's Government of National Accord, in sunglasses, performs Eid al-Fitr prayers at the Martyrs Square in Tripoli on June 4, 2019. Mahmud Turkia / AFP - Getty Images

"We are troubled by the ongoing military offensive by Khalifa Haftar and his Libyan National Army, and concerned that this campaign threatens civilians and could reignite a more violent civil war," wrote Sens. Bob Menendez, D-N.J., Lindsey Graham, R-S.C., Chris Murphy, D-Conn., and John Barrasso, R-Wyo.

Since Haftar's offensive on Tripoli began in early April, fighting has left 460 dead and more than 2,400 wounded, and forced 75,000 from their homes, according to the United Nations.

Libya has been divided and lawless since NATO airstrikes helped oust dictator Moammar Gadhafi from power in 2011.

Haftar is a former general in Gadhafi's army who later turned against him. He eventually had to be rescued by the CIA and lived in Virginia for 20 years, gaining citizenship before returning to Libya in 2011 — before Gadhafi was toppled.

Now Haftar presides over a rival administration in Benghazi and has said that the North African nation is not ready for democracy.

Maiteeg said Haftar was able to keep up military operations because of outside help from the United Arab Emirates, Egypt and other powers.

A U.N. report in 2017 found that the Emiratis were providing military and logistical assistance to Haftar's self-styled Libyan National Army, which controls territory in the country's east.

The fighting has allowed Islamic State militants, which were beaten back with the help of U.S. forces in recent years, to regroup and renew attacks, Maiteeg said.

"Our forces that were occupied fighting ISIS, they all went to defend the capital" from Haftar's troops, which created an opening for the extremists, he added.

U.N. Special Representative to Libya, Ghassan Salamé, delivered a bleak assessment of the situation in Libya last month, telling the U.N. Security Council that the North African nation risks "descending into a civil war which could lead to the permanent division of the country."