The Spanish Prisoner is a confidence trick originating by at least the early 19th century, as Eugène François Vidocq described in his memoirs.
[1][2] In its original form, the confidence trickster tells his victim (the mark) that he is (or is in correspondence with) a wealthy person of high estate who has been imprisoned in Spain under a false identity.
[3] Supposedly the prisoner cannot reveal his identity without serious repercussions, and is relying on a friend (the trickster) to raise money to secure his release.
[3] In this classic pigeon drop game archetype, the trickster offers to let the mark put up some of the funds, with a promise of a greater monetary reward upon release of the prisoner, and sometimes the additional reward of marrying a beautiful woman stated to be the prisoner's daughter.
With such explanations, the trickster continues to press for more money until the victim is cleaned out, declines to put up more funds, or dies.