A former deputy prime minister of Portugal has been elected to head up the UN's migration agency, the International Organisation of Migration which is based in Geneva.
Antonio Vitorino, who was also a European Commissioner, beat two other candidates from the United States and Costa Rica in a secret ballot.
The position traditionally goes to an American, but President Trump's candidate was rejected.
Trump has previously called for UN budgets to be cut which may have affected the voting.
Before the vote Ken Isaacs had made disparaging remarks about Muslims and had been forced to apologise.
In a tweet he had also once wrote that Austria and Germany should consider building a wall to keep refugees out:
"#immigration #wall #Austria #Switzerland consider#buildingawall in #Alps to control their borders from refugees,"
He was a controversial candidate for previously denying any link between human activity and climate change.
Isaacs is vice-president of an evangelical Christian international aid agency called Samaritan's Purse.
The IOM promotes international co-operation on migration issues and provide humanitarian assistance to migrants in need.
It has a multi-billion euro budget and works in 100 countries.