The US Senate has confirmed former CIA director Mike Pompeo as secretary of state, ending a tough confirmation battle.

Mr Pompeo had been accused by Democrats of being a war hawk and harbouring anti-Muslim and homophobic views.

The Senate voted 57-42 to approve him as America's top diplomat, the second of the Trump presidency.

His predecessor, Rex Tillerson, was sacked last month by the president via Twitter amid a personality clash.

Republican senators, who control the upper chamber, voted unanimously on Thursday to confirm Mr Pompeo. Six Democrats joined them.

Some of those Democrats - including North Dakota's Heidi Heitkamp and West Virginia's Joe Manchin - come from states that President Donald Trump won in 2016.

The approval comes in time for Mr Pompeo - a former hardline conservative congressman from Kansas - to lead a US delegation to Nato foreign minister talks in Brussels this weekend.

In a statement, Mr Trump applauded his new secretary of state as someone who "will always put the interests of America first".

"Having a patriot of Mike's immense talent, energy, and intellect leading the Department of State will be an incredible asset for our country at this critical time in history," he added.

Mr Pompeo has been arranging a summit between Mr Trump and North Korea's leader Kim Jong-un. The meeting could happen in the coming months.

White House spokeswoman Sarah Sanders tweeted a photo of Mr Pompeo watching on TV as the Senate held their vote.

State department spokeswoman Heather Nauert said on Twitter that Mr Pompeo told her he is "delighted to be Secretary of State, completely humbled by the responsibility and looking forward to getting to work".

Less than an hour after he was sworn in by Supreme Court Justice Samuel Alito, he boarded a military plane for Belgium.

"No other Secretary of State in modern history has travelled so soon after confirmation," said Mrs Nauert.

Before he was confirmed, Senate Foreign Relations Committee Chairman Bob Corker described him as the "perfect person to come in at this time and lead" talks with North Korea.

Over the Easter holiday he travelled to Pyongyang, where he met Mr Kim.

Mrs Sanders tweeted photos of the two from that trip after Mr Pompeo's confirmation, saying "he will do an excellent job".

On Tuesday, Mr Trump described the North Korean ruler as "very honourable", after months of deriding him as "Little Rocket Man".

US Ambassador to the United Nations Nikki Haley also congratulated Mr Pompeo following the confirmation vote.

After travelling to Brussels he will next go to Israel, where he is expected to meet Prime Minister Benjamin Netanyahu in Jerusalem.

During that trip he will also visit Saudi Arabia and Jordan to "discuss critical and bilateral issues", according to a statement from the state department.