The manager of Qatar's rise to global prominence, former Prime Minister Sheikh Hamad bin Jassim al-Thani, used charm, tenacity and economic clout to broker peace and topple dictators overseas and build an investment nest-egg for future generations at home.
Sheikh Hamad was replaced as prime minister and foreign minister in a cabinet reshuffle announced on Wednesday, following the accession of 33-year-old Sheikh Tamim bin Hamad al-Thani as emir.
There was no immediate word on whether he would retain his job as vice chairman of the Qatar Investment Authority (QIA), a sovereign wealth fund with assets believed to be $100-200 billion, although Qatar watchers expect him to keep that job.
During his two decades as foreign minister, Qatar hosted the largest US air base in the Middle East but also cozied up to America's foes Iran, Syria and Hamas in pursuit of leverage. Last week the Afghan Taliban also opened an office in Doha.
At the heart of Doha's rise to international limelight was a decision made early on in the rule of Sheikh Hamad bin Khalifa al-Thani to end a tradition of automatic deference to Saudi Arabia, the dominant power in the Arabian peninsula.
The independent-minded policy that resulted saw tiny Qatar punch well above its weight in world affairs, striding the stage as a peace broker, often in conflicts in Muslim lands.
The country's boldness contributed to Qatar's success as a regional mediator - Doha developed an ability to engage almost everyone from the United States to Hezbollah, and even eventually Saudi Arabia, an old foe and regional powerbroker.
Qatar's unusual foreign alliances amazed its friends and astounded its critics. For example, it went further than most of its neighbours in establishing contacts with Israel, although these were later ended.
Alongside foreign policy, Sheikh Hamad's role at the QIA has given him authority over its numerous acquisitions, which in recent years included London department store Harrods, Singapore's Raffles hotel and stakes in German sports car maker Porsche and Barclays bank.
He owns personal stakes in many Qatari companies, including Qatar Airways as well as Project Grande (Guernsey), the developer of London's One Hyde Park project and several hotels in Doha; his personal wealth is estimated to be in the billions.
"He has been one of the primary architects of the Qatar project, along with the emir. His practical domestic influence has been second to none," said David Roberts, director of the Royal United Services Institute based in Doha.
"He has also been an extremely effective salesman of Qatar, and has helped boost its cache abroad tremendously."
Sheikh Hamad, appointed foreign minister in 1992, played a key role in facilitating the 1995 coup in which his cousin, the country's outgoing Emir Sheikh Hamad bin Khalifa al-Thani, seized power from his father.
For this, he appears to have been rewarded with influence for life.
"Hamad bin Jassim will be very difficult to replace, largely because he was an extremely charismatic figure. He brought a distinct charisma and energy, the intangible qualities of what it takes to be a truly good diplomat," said Michael Stephens, researcher at the Royal United Services Institute based in Doha.
Named prime minister in 2007, Sheikh Hamad played a personal role in facilitating Qatar's numerous conflict resolution efforts, brokering talks in conflicts ranging from Lebanon to Yemen and Darfur to the Palestinian territories.
In 2007, he brought the Lebanese government and Hezbollah-led opposition to Qatar for talks to try to resolve a broader political showdown that had paralyzed the country for more than a year, helping to end the worst internal fighting in Lebanon since the country's civil war.
In 2009, he helped broker a peace agreement between the government of Sudan and the country's Justice and Equality Movement, helping to largely quell the conflict in Darfur.
Sheikh Hamad also promoted the Arab Spring, in which Qatar lent significant support to rebels fighting Libyan leader Muammar Gaddafi by supplying them with weapons and fuel.
The state has also been Egypt's top financial backer, signalling an intention to play a leading role in rebuilding the economy of the most populous Arab country after a 2011 uprising.
Some officials in other Gulf Arab states believe Qatar has a long-term strategy to use the Muslim Brotherhood, an international movement that seeks to bring about Islamist rule in Muslim states through peaceful means, to redraw the region.
In March, Sheikh Hamad for the first time publicly dismissed allegations of any partiality to the Brotherhood.
"The Ikhwan (Brotherhood) was not in power when we visited Egypt and gave $2 billion. It was under the rule of the military, actually. We were there before there were elections," he told a news conference.
"We have been accused of trying to buy Egypt. Egypt is bigger than our money."
Qatar's energetic support for Syria's rebels has been criticised by some Western and Gulf Arab officials for handing arms and cash indiscriminately to militant Islamists who want a Sunni Islamist state in Syria.
Qatar says it simply wants Assad removed from power and the killing of civilians stopped. But some analysts say its support for the rebels may crimp its ability to present itself as an honest broker in future conflicts.
"After the conflict in Syria, Qatar cannot any longer pose like this in the Arab world," said Neil Partrick, a Gulf security expert.