After East Timor achieved independence in 2002, Ramos-Horta was appointed as the country's first Foreign Minister. He served in this position until his resignation on 25 June 2006, amidst political turmoil. On 26 June, following the resignation of Prime Minister Mari Alkatiri, Ramos-Horta was appointed acting Prime Minister by the President, Xanana Gusmão. Two weeks later, on 10 July 2006, he was officially sworn in as the second Prime Minister of East Timor. On 11 February 2008, Ramos-Horta was injured when he was shot during an assassination attempt.
Ramos-Horta studied Public International Law at the Hague Academy of International Law (1983) and at Antioch University where he completed a Master of Arts degree in Peace Studies (1984). He was trained in Human Rights Law at the International Institute of Human Rights in Strasbourg (1983). He attended Post-Graduate courses in American Foreign Policy at Columbia University in New York (1983). He is a Senior Associate Member of the University of Oxford's St Antony's College (1987).
He is divorced from Ana Pessoa Pinto, East Timor's Minister for State and Internal Administration. They have a son, Loro.
A moderate in the emerging Timorese nationalist leadership, he was appointed Foreign Minister in the "Democratic Republic of East Timor" government proclaimed by the pro-independence parties in November 1975. When appointed minister, Ramos-Horta was only 25 years old. Ramos-Horta left East Timor three days before the Indonesian troops invaded to plead the Timorese case before the United Nations.
Ramos-Horta arrived in New York to address the UN Security Council and urge them to take action in the face of the Indonesian occupation during which an estimated 102,000 East Timorese would die. Ramos-Horta was the Permanent Representative of FRETILIN to the UN for the next ten years. His friends at that time mentioned that he arrived in the United States with a total of twenty-five dollars in his pocket. His pecuniary situation was often straitened in that period; he survived partly by grace of Americans who admired his politics and his determination. Further, he was obliged to travel worldwide to explain his party's position.
In 1993, the Rafto Prize was awarded to the people of East Timor. Foreign-minister-in-exile José Ramos-Horta represented his nation at the prize ceremony.
In December 1996, Ramos-Horta shared the Nobel Peace Prize with his fellow countryman, Bishop Ximenes Belo. The Nobel Committee chose to honour the two laureates for their "sustained efforts to hinder the oppression of a small people", hoping that "this award will spur efforts to find a diplomatic solution to the conflict of East Timor based on the people's right to self-determination". The Committee considered Ramos-Horta "the leading international spokesman for East Timor's cause since 1975".
Ramos-Horta played a leading role in negotiating the institutional foundations for independence. He led the Timorese delegation at an important joint workshop with UNTAET on 1 March 2000 to tease out a new strategy, and identify institutional needs. The outcome was an agreed blueprint for a joint administration with executive powers, including leaders of the National Congress for Timorese Reconstruction (CNRT). Further details were worked out in a conference in May 2000. The Special Representative of the UN Secretary-General in East Timor, Sérgio Vieira de Mello, presented the new blueprint to a donor conference in Lisbon, on 22 June 2000, and to the UN Security Council on 27 June 2000. On 12 July 2000, the NCC adopted a regulation establishing a Transitional Cabinet composed of four East Timorese and four UNTAET representatives. The revamped joint administration successfully laid the institutional foundations for independence, and on 27 September 2002, East Timor joined the United Nations. Ramos-Horta was its first Foreign Minister.
On 3 June 2006, Ramos-Horta added the post of Interim Minister of Defense to his portfolio as Foreign Minister, in the wake of the resignations of the previous minister. He resigned as both Foreign and Defence Minister on 25 June 2006, announcing, "I do not wish to be associated with the present government or with any government involving Alkatiri. Prime Minister Alkatiri had been under pressure to resign his position in place of President Xanana Gusmão, but in a June 25 meeting, leaders of the FRETILIN party agreed to keep Alkatiri as Prime Minister; Ramos-Horta resigned immediately following this decision. Foreign Minister of Australia Alexander Downer expressed his personal disappointment at Ramos-Horta's resignation. Following Alkatiri's resignation on 26 June, Ramos-Horta withdrew his resignation to contest the prime ministership and served in the position on a temporary basis until a successor to Alkatiri was named. On 8 July 2006, Ramos-Horta himself was appointed Prime Minister by President Gusmão. He was sworn in on 10 July 2006.
Before his appointment as Prime Minister, Ramos-Horta was considered a possible candidate to succeed Kofi Annan as United Nations Secretary-General. He dropped out of the race in order to serve as East Timor's Prime Minister, but he has indicated that he might run for the UN position at some time in the future: "I can wait five years if I am really interested in the job in 2012. I would be interested in that.
In an interview with Al Jazeera broadcast on 22 February 2007, Ramos-Horta said that he would run for president in the April 2007 election. On 25 February 2007, Ramos-Horta formally announced his candidacy. He received the support of Gusmão, who was not running for re-election.
In the first round of the election, held on 9 April, Ramos-Horta took second place with 21.81% of the vote; he and FRETILIN candidate Francisco Guterres, who took first place, then participated in the second round of the election in May. The full results of the runoff elections were made public by East Timor's National Electorial Committee spokeswoman, Maria Angelina Sarmento, on 11 May, and Ramos-Horta won with 69% of the vote.
Ramos-Horta was released from the Royal Darwin Hospital on 19 March, although he said that he would stay in Australia for physical therapy for "a few more weeks". He also said on this occasion that he had remained conscious following the shooting and "remember[ed] every detail", describing how he was taken for treatment. On April 17, Ramos-Horta returned to Dili from Darwin. He gave a press conference at the airport in which he urged the remaining rebels in the mountains to surrender.