IN a devastating act of ultimate revenge, a dying Elizabeth Ed­wards recorded a bombshell secret videotape for prosecutors – nailing her cheating husband John as he will stand trial on charges that could land him behind bars for 30 years.

That’s the stunning secret behind the federal indictment brought against the disgraced former presidential candi­date on June 3 – following a two-year grand jury investigation into whether he illegally used campaign funds to cover up his affair with his then-pregnant mistress Rielle Hunter.

“Elizabeth wanted to exact revenge against John for destroy­ing their 33-year marriage and family by cheating with Rielle,” source close to the scandal told ENQUIRER.

“It was Elizabeth’s idea to secret­ly record a video and tell what she knew of the affair and John’s horrific betrayal.”

Before her death in December 2010 at age 61, Elizabeth got newly engaged daughter Cate, 29, to agree that if anything happened to John, she would take care of the youngsters with the help of relatives and friends.

“It was then – without Cate’s knowledge – that Elizabeth turned the video camera on herself. She passed the video to a close friend and asked that it be sent to prosecutors,” said the source.

“On the secret video, Elizabeth spells out EVERYTHING she knew.

 “Elizabeth wanted to haunt John and Rielle – literally from her grave – and she has”.

For the full story with all the details – it’s only in the new ENQUIRER – on sale NOW!