The Election Commission said the 86-year-old political veteran had won from Nemom constituency in Thiruvananthapuram district by over 8,000 votes. He defeated outgoing CPI-M legislator V. Sivankutty.
Even before his victory was announced, hundreds of Bharatiya Janata Party supporters began celebrating outside the counting centre.
Rajagopal had contested the Thiruvananthapuram Lok Sabha seat in 1999, 2004 and 2014. He finished in the second place behind Shashi Tharoor of the Congress in 2014.
He had also contested the 2011 assembly polls from Nemon and finished second. In a 2012 by-election in Neyyatinkara, he secured more than 30,000 votes but could not win.
The BJP had so far never won an assembly or Lok Sabha seat in Kerala.