MONTREAL -- The spirits of Canadian politicians were soaring Friday with news that the country's only UN agency, the International Civil Aviation Organization, will not be flying the coop.

Qatar had aggressively courted a move of the agency to Doha, going so far as saying diplomats were fed up with Montreal's bone-chilling winter weather.

But Foreign Affairs Minister John Baird said the climate was much warmer when he spoke to Qatari Prime Minister Sheikh Hamad bin Jassim al-Thani Thursday afternoon.

"He said that Qatar values their good relationship with Canada and wanted it to continue," Baird said in a telephone interview with The Canadian Press from Chicago.

It was a bright spot at the end of a dark week for a federal government weathering a spending scandal; a city slapped with a boil-water advisory atop corruption scandals and subway shutdowns; and a provincial government that saw its poll ratings in a freefall.

It's a notable win for the Conservative government at the United Nations, where its lobbying efforts have not always been so successful.

Most famously, the Tories oversaw Canada's first defeat since 1946 in a vote for a temporary seat on the Security Council.

The government has also tussled with the UN over several issues including international treaties and helped lead a boycott of the UN anti-racism conference that it criticized as a forum for anti-Semitism.

And in March, the government pulled out of a UN convention that fights drought in Africa and elsewhere, saying it is not interested in supporting a bureaucratic "talkfest."

Baird himself recently took the body to task for what he called mean-spirited, anti-Semitic, and anti-Western comments by the UN's special rapporteur on human rights in the Palestinian territories.

But he was upbeat Friday when asked about how the ICAO decision bodes for Canada down the road.

"Obviously, we're pleased about this decision," he said. "I spoke to the better part of five dozen foreign ministers around the world. We've received very good support around the world and that's certainly gratifying."

Baird said he drew support from Asia, Africa, the Americas and Europe. He also praised his counterparts in the Quebec government and the City of Montreal who he said joined with him in "a united front."

The political mood was so upbeat following the news that there was even a temporary thaw in relations between the federal Tories and Quebec's separatist government. The Parti Quebecois minister responsible for the file issued a jubilant message that mentioned the federal efforts.

Quebec International Relations Minister Jean-Francois Lisee added that the outcome showed Montreal's strength to attract and retain international organizations.

He said he'd been confident Montreal would have won the crucial vote in September and the Qataris drew the same conclusion, prompting them to withdraw.

Lisee said there had been signs on the diplomatic front for the last two weeks that the Qataris were going to ditch their idea and there was considerable resistance to putting the move up for a vote.

"This incident with the Qataris allowed us to do the biggest promotional campaign for Montreal in the international diplomatic network that we've done since Expo '67," he said in London. "This was very beneficial for Montreal."

Industry Minister Christian Paradis agreed that the Qataris realized their efforts wouldn't win. Qatar would have needed the approval of at least 60 per cent of the 191 member states.

"They didn't want to have bad relations with us and when they knew it was a national priority for us, when they saw how serious we were, how strong we lobbied -- over 100 countries -- they decided to withdraw," he said in Ottawa. He credited Baird's work on the file.

"This was the good thing to do and I thank them."

ICAO Secretary General Raymond Benjamin learned of Qatar's withdrawal in a letter Thursday evening and advised the body's council on Friday morning.

"Montreal has been our home for many decades," he said in a statement.

"While the offer to move us to Doha was extremely generous, ICAO is also very pleased to continue its global mission with the support and co-operation of the Canadian and local governments who have hosted our headquarters for so many years now."

Qatar had wanted to move the headquarters, starting in 2016.

The organization has been in Montreal since it was founded in 1947. Its current headquarters were built in the 1990s at a cost of $100 million.

Intense lobbying had characterized the bid by Qatar to get the headquarters and Canada's efforts to keep it.

It came to a point where the two countries criticized each other's weather.

Qatar argued it would be nice to escape Montreal's frigid winters while Canadian politicians asked if delegates really wanted to have to endure Doha's blistering year-round heat.

Baird said there had been no quid pro quo efforts to sweeten ICAO members' attitudes to Montreal. However, he said the government wants to work to provide the best services to diplomats in Canada.

Prime Minister Stephen Harper had weighed into the debate. He said Canada had been a good host and suggested it only seemed natural that the civil aviation authority be in a hub of the international aerospace industry.

Canada was also supported in its efforts by U.S. Ambassador David Jacobson, who said his country would not back any move.

The Qatari bid had been seen by government critics as being politically motivated and a reflection of Canada's pro-Israel policy in the Middle East -- although Baird has characterized Canada's relationship with the Arab world as "excellent."

The rift between Canada and some Arab states extends to issues beyond Israel, though. The two sides have only just started to patch up holes in their relationship that were the result of long-standing aviation issues.

Both Qatar and the United Arab Emirates have been lobbying Canada vigorously for more landing rights for their airlines, only to see their efforts continually blocked by domestic airlines. Baird said using ICAO as a bargaining chip wouldn't work.

Losing ICAO would have been a financial and political blow for Canada.

Montreal is the hub of Canada's aviation industry, and its international reputation as a major player is partly based on ICAO's longtime residency.

The organization also feeds the city's economy; it employs 534 staff and says it generates some $119 million annually and 1,200 direct and indirect jobs.

-- With files from Stephanie Levitz in Ottawa and Pierre St-Arnaud in Montreal