Bayar was born in Ulan Bator, the capital of Mongolia, in 1956. He is twice divorced, and has six children.
In 1978, he completed his law degree at the Moscow State University. From 1979 to 1983 he worked as an officer at the General Staff of Mongolia's Armed Forces. From 1983 to 1990, Bayar worked as a journalist and editor at the Montsame and Mongolpress news agencies. From 1990 to 1992 he was member of the State Baga Hural. From 1992 to 1997 he taught at the Academy of Social Sciences, studied in Washington, DC, and was director of the Mongolian Ministry of Defense's Institute for Strategic Studies. From 1997 to 2001 he was the chairman of the Mongolian Presidential office, and from 2001 to 2005 he was Mongolia's Ambassador to Russia.
Bayar joined the Mongolian People's Revolutionary Party (MPRP) in 1988. He became General Secretary of the MPRP in 2005 and was – by 377 to 229 votes – elected Chairman of the MPRP at a party congress in October 2007, defeating incumbent Miyeegombyn Enkhbold. The same congress also voted in favor of Bayar becoming the next Prime Minister. The Parliament approved Bayar as Prime Minister of Mongolia on 22 November 2007, with 67 votes in favor (97.1%) and two against.
He began his career as Prime Minister with verbal attacks (speech at his appointment) against Tsakhiagiin Elbegdorj and the nationalisation of the 15% share of Mongolian companies in the Tavantolgoi mine, making it a 100% public venture, thus inducing enthusiasm of Russian companies in the large coal deposit. Most of the members of a three-party coalition government, led by Bayar and dominated by the MPRP, were approved by Parliament on 5 December 2007; the government included Bayar's predecessor, Miyeegombyn Enkhbold, as Deputy Prime Minister. This government was planned to serve until the June 2008 parliamentary election. On 11 September 2008, following the MPRP's victory in the June parliamentary election, S. Bayar was elected as the new Prime Minister of a coalition government between the MPRP and DP. Under his leadership, the Mongolian Government finally signed an investment agreement to mine the Oyu Tolgoi copper deposit. The deal was later revealed that in fact it was in favor of the investors. According to some sources, after his resignation he moved to the US and bought several properties on his daughter and relatives names. Later it was found that he has several offshore accounts. It is believed that he still has influences on MPP which is confirmed by a leaked video footage in which he gives advices to Miyegombo Enkhbold, the official head of the party, for his presedential election speech preparation.
On 1 July 2008 Nambaryn Enkhbayar, President of Mongolia of that time announced State of Emergency in the midnight after the riot was over. During his announced State of Emergency the police chased civilians and shot four civilians to death from their backs and severely injured a dozen of civilians to life disability in streets different from demonstration or riot location. Also the police arrested approximately 1000 people in street or from random locations whether connected to the riot or not and imprisoned them including children and women without legal advocacy and inhumanely and degradingly treated them with torture involved as they claimed and later released some of them and sentenced some of them. Victims, and their families, civil societies claim the responsibility to Nambaryn Enkhbayar who announced the state of emergency in the middle of night - uncustomary hour of announcing state of emergency and shooting civilians without weapons in streets by chasing them and shooting them from their backs in random locations. A wounded teenager to lifelong disability and witnesses confirmed that they were shot by the police. The police is the state enforcement agency under the government, thus President Nambaryn Enkhbayar, Prime Minister Sanjaagiin Bayar and Minister of Justice Munkh-Orgil have been blamed by the victims, their families, and civil societies for the deaths.
Bayar was admitted to a hospital in Ulan Bator in October 2009. Because of his declining health, Bayar announced his resignation in a letter to Mongolia's parliament one week later on 26 October 2009. A meeting held two days later confirmed that the Mongolian parliament had accepted his resignation. Bayar apologised to those who had voted for him. Norov Altankhuyag, the First Vice Prime Minister, temporarily moved up as Bayar's replacement. Bayar then was replaced by Sükhbaataryn Batbold on 29 October 2009.
On 8 April 2010, Sanjaagiin Bayar read his written request to resign from the chairmanship of former communist party Mongolian People's Revolutionary Party due to declining health reasons to the conference of the party and then was replaced by Sükhbaataryn Batbold for the position on the same day from the party conference.