Mr Vieira de Mello had been widely tipped for the Iraq post
Sergio Vieira de Mello, the UN's special representative in Iraq who has been killed in Baghdad, was an experienced and widely respected diplomat.
UN Secretary General Kofi Annan wasted no time in deciding who should take on the key role of his special representative to Iraq.
It was an open secret that Sergio Vieira de Mello, then UN high commissioner for human rights, was the main contender for the post.
The Brazilian diplomat's steady, pragmatic style guided him through a 33-year career in the United Nations.
In late 2002 he took over from Mary Robinson as head of the UN's Human Rights Commission, a tough and often controversial job.
And his most recent - and final - mission to Iraq proved equally difficult. Mr Vieira de Mello had to carefully assert the UN's role in Iraq against occupying forces keen to retain the final say.
Long UN career
Born in Rio de Janeiro in 1948, he joined the organisation while studying philosophy and humanities in his home city and the Sorbonne University in Paris.
1981: Adviser to UN forces, Lebanon
1996: Humanitarian coordinator, Rwanda
1999: Special representative for Kosovo
2000: Head of UN operations, East Timor
2002: UN Commissioner for Human Rights
2003: UN special representative in Iraq
He spent the majority of his career working for the UN's High Commissioner for Refugees office in Geneva, and served in Bangladesh, Sudan, Cyprus, Mozambique, Peru and Yugoslavia.
Mr Vieira de Mello's first high-profile role came in 1981, when he was appointed principal adviser to UN forces in Lebanon.
Two years later he returned to a management post in Geneva.
After the Rwandan genocide in the mid-1990s, he spent several months working as humanitarian coordinator for the Great Lakes region in 1996.
He was later appointed deputy high commissioner for refugees, before being promoted to the position of under secretary for humanitarian affairs.
He then worked as Kofi Annan's special representative for Kosovo.
East Timor mission
Mr Vieira de Mello took the lead in the UN's operations in East Timor.
Commentators say his successful overseeing of the territory's fractious transition from Indonesian province to independence was his greatest achievement.
The UN mission in East Timor was a major challenge
The mission was not without its dangers: a visiting correspondent from the South China Morning Post recalled a poster on the wall of his office requesting visitors to unload their weapons.
Mr Vieira de Mello described the peaceful election of independence leader Xanana Gusmao as president in April as "a truly historic moment".
Although some analysts said he lacked hands-on experience in the field, he spent 30 years working for the UN in some of its most difficult missions and his appointment to the top UN human rights job was welcomed by Britain and the United States.
As the UN's special representative in Iraq, correspondents say Mr Vieira de Mello quickly won the respect of the US administrator, Paul Bremer, despite tension between Washington and the UN over the US-led invasion.
Although he played no obvious part in the formation of Iraq's new governing council - chosen by the US-led coalition - Mr Vieira de Mello toured Iraq's neighbours urging them to give their backing to the institution.
However he also recognised the delicate nature of the UN's mission in Iraq.
He told the Security Council in July: "The United Nations
presence in Iraq remains vulnerable to any who would seek to
target our organisation."
Mr Vieira de Mello was appointed to the posting in Iraq on the understanding that he would return to his permanent position as UN high commissioner for human rights after four months.