Foreign Secretary Boris Johnson arrives at Downing Street ahead of the weekly cabinet meeting on July 3, 2018 in London, England.

President Donald Trump praised Britain's former foreign minister Boris Johnson on Friday, days before Trump's three-day state visit to London.

"I actually have studied it very hard. I know the different players. But I think Boris would do a very good job. I think he would be excellent. I like him. I have always liked him," Trump told The Sun newspaper.

Johnson is one of Britain's most globally prominent but domestically-divisive politicians, and is a potential replacement for Prime Minister Teresa May, who steps down as Conservative Party leader on June 7.

Johnson is a hard-line proponent of Brexit, recently argued that Britain must stick to an October 31 Brexit deadline and indicated he would take the U.K. out of Europe without a deal.

Trump has not endorsed any candidate to be the new UK prime minister, but told reporters on Thursday that he had great respect for Johnson and Nigel Farag, another high-profile Brexit supporter.

In the Sun interview, Trump said that other conservative lawmakers had sought his endorsement. "I could help anybody if I endorse them," he said.

Representatives for the White House and for Johnson did not immediately return request for comment from CNBC.

Read the full Sun interview.

—CNBC's Willem Marx contributed to this report.