Mahajan, 60, succeeded Hawa Singh Hooda as the government's top legal officer, an official spokesman said.
After being appointed as the advocate general, Mahajan said he will try to cut down on state litigation and ensure proper representation of the state before the high court and the apex court.
Moving to the city in 1971, Mahajan worked as a clerk for more than a decade. Mahajan used to earn Rs 250 a month and after work he would attend College in the evening to pursue his Bachelor of Arts course.
His father Munshi Ram ran a small grocery shop in Amritsar, struggling to make ends meet and feed a large family of eight children. Mahajan worked at a factory for four years so he could pay his school fees, then left his hometown to work as a clerk with a lawyer in Chandigarh so that he could complete his graduation.
Not having the money to pay for his education, the 18-year-old Mahajan asked advocate D V Sehgal for some work so that he could study further.
Sehgal made him a clerk in his new office in Chandigarh. With the assistance of Sehgal, Mahajan finally got admission in Rajasthan's Bikaner University.
After graduating, Mahajan joined Sehgal as an associate lawyer in 1982. And, in 1985, when Sehgal became a high court judge, Mahajan got the opportunity to practice independently.
Considered an expert in civil law, Mahajan is associated with RSS. He is currently the national president of Akhil Bharatiya Adhivakta Parishad. Also in the race for the coveted post was BJP's senior leader and fromer MP from the city Satyapal Jain.