During the 1300s the King was unhappy with his son, Dom Pedro, and Inês's affair, so he had Inês executed.
But when Dom Pedro was later crowned King of Portugal, he claimed he had wedded Inês before her death, and that she was the lawful queen.
According to legend he exhumed her body, put her on the throne, and forced the entire court to swear their allegiance by kissing her hand. Apparently people did. I think I would have just moved away from Portugal.