The Lok Sabha elections of 1996 brought the BJP to power and Mahajan was appointed Defence Minister in Vajpayee's 13-day ministry. When the BJP returned to power in 1998, he was first appointed as advisor to the Prime Minister. He resigned from that post and stood for Rajya Sabha elections in July 1998. He won and in December 1998, he was appointed the Minister for Information and Broadcasting, and Food Processing. A year later, in October 1999, he was moved to Parliamentary Affairs and Water Resources. He relinquished Water Resources a month later in November and took charge of Information Technology (in addition to Parliamentary Affairs).