Hasanov was the Prime Minister of Azerbaijan during the most difficult period of the country, in 1990–1992. After Azerbaijan became independent, he was put in charge to form the new government of Azerbaijan. Understanding the difficulties, Hasanov made a deal with the Popular Front of Azerbaijan inviting them to form a coalition within the newly established government. In 1992–1998, he served in diplomatic service of independent Azerbaijan and was the first Azerbaijani to receive the status of Azerbaijan's Ambassador Extraordinary and Plenipotentiary. In 1992–1993, Hasanov established and worked in the Permanent Mission of Azerbaijan Republic to UN in New York City. From 1993 through 1998, he served as the Minister of Foreign Affairs of Azerbaijan.