Rao, who was representing Nandigama assembly constituency in Krishna district, suffered the heart attack around midnight. He was shifted to a nearby hospital, where doctors declared him dead, TDP sources said.
Earlier Sunday, the TDP leader had a hectic day during which he attended various programmes along with State Irrigation Minister D. Umamaheswara Rao.
Prabhakar Rao, 64, is survived by two daughters and a son. His wife had died a few years ago.
In the recent election, he was re-elected to the assembly from Nandigama. He was yet to take oath as the legislator.
Chief Minister N. Chandrababu Naidu has expressed shock over the legislator's death. The TDP chief will be leaving for Nandigama later in the day to pay his last respect.
Prabhakar Rao's death caused second vacancy in 175-member state assembly.
By-election to Allagadda constituency in Kurnool district is already pending as YSR Congress Party candidate Shobha Nagi Reddy had died in an accident during the campaigning.