Donald Trump came to the defence of Rudy Giuliani on Saturday, only a day after he said he didn’t know if the former New York mayor was still his personal attorney and it was reported that Giuliani is under federal investigation in Manhattan.

Giuliani “may seem a little rough around the edges”, Trump tweeted, “but he is also a great guy and wonderful lawyer”.

The president did not say whether or not Giuliani was still his personal attorney. The former mayor said on Friday he was.

Giuliani is under pressure over his extra-governmental role in Trump’s attempts to pressure Ukraine to investigate Joe Biden, a potential opponent in the 2020 election, over unfounded allegations of corruption involving the former vice-president’s son.

The Ukraine scandal is driving a formal impeachment inquiry by Democrats on Capitol Hill.

Two Soviet-born US citizens, both associates of Giuliani, were arrested on Wednesday on suspicion of campaign finance violations, while trying to leave the US on one-way tickets.

On Friday, the New York Times reported that Giuliani himself was under federal investigation over his work on and in Ukraine. The same paper also reported that in 2017 Giuliani tried to get a client released as part of a prisoner swap with Turkey, a move blocked by Trump’s first secretary of state, Rex Tillerson.

Such a one-sided Witch Hunt going on in USA. Deep State. Shameful! Donald Trump

Trump has seemed recently to begin to distance himself from Giuliani, amid reports that allies of the president want the voluble former mayor to keep quiet.

The impeachment inquiry run by House Democrats is gathering pace, dragging the state department and senior diplomats into a morass of hearings, subpoenas and bare-knuckle political fights.

On Friday the former US ambassador to Ukraine Marie Yovanovitch testified in private before House committees conducting the impeachment inquiry, having defied White House and state department efforts to block her.

Discussing her controversial removal, Yovanovitch said: “The harm will come when private interests circumvent professional diplomats for their own gain, not the public good.”

As he left the White House for a campaign rally in Louisiana, the president was asked if Giuliani was still his personal attorney.

“I don’t know,” Trump said. “I haven’t spoken to Rudy. I spoke to him yesterday briefly. He’s a very good attorney, and he has been my attorney.”

Giuliani told the Washington Post he was still representing Trump. On Saturday, a Yahoo News reporter said he had “just texted” with Giuliani, who said “he never worried Trump would cast him aside and attributed reports of a potential rift to people ‘leaking to be malicious’.”

Analysts have questioned the common description of Giuliani as Trump’s lawyer, given the apparently non-legal nature of his work. Giuliani has suggested attorney-client privilege would protect him from congressional scrutiny. That notion has been placed in doubt.

Trump’s former personal attorney, Michael Cohen, is serving a three-year jail term for crimes including campaign finance violations he says were committed by order of his boss. It was reported this month that Cohen wants to write a tell-all book, once he regains his freedom.

On Saturday morning, after leaving the White House for his golf course in Sterling, Virginia, Trump tweeted: “So now they are after the legendary ‘crime buster’ and greatest Mayor in the history of NYC, Rudy Giuliani. He may seem a little rough around the edges sometimes, but he is also a great guy and wonderful lawyer.”

Giuliani, 75, was mayor of New York from 1994 to 2001, earning lasting praise for his leadership in the aftermath of the 9/11 attacks. In 2012, he briefly ran for the Republican presidential nomination. Before entering politics, he was a tough and successful US attorney for the southern district of New York – the office which is now investigating him.

“Such a one[-]sided Witch Hunt going on in USA,” Trump insisted on Saturday. “Deep State. Shameful!”

The reference to the “Deep State” was to a popular rightwing conspiracy theory which posits the existence of a permanent government of intelligence officials and bureaucrats, dedicated to stymying Trump’s agenda.

The former Trump campaign chair, White House strategist and Breitbart News supremo Steve Bannon, a prime mover behind the popularisation of the conspiracy, is on record as saying “none of this is true” and the theory is “for nut cases”.