On Tuesday evening, after weeks of controversy and to a huge outcry, the court ruled that just like they had done for decades in accordance with the law, customers getting mortgages would continue to pay the tax.
That same court had decided the exact opposite just three weeks prior on October 18.
But after Spain's banking shares dived, it decided to re-examine the decision, leading to its change of heart.
In rare criticism of the justice system in a country whose government vaunts the separation of powers, Sanchez asked the Supreme Court to engage in "self-critique."
He said his government would adopt a decree on Thursday aimed at modifying the law that regulates property transactions.
"Spaniards won't ever again pay this tax which will be paid by the financial sector, by banks," he said.
His decision to challenge the Supreme Court comes at a time of suspicion in Spain of the independence of judicial authorities, heightened by Catalonia's secession crisis and the severe charges pressed against separatist leaders.
"This is about the reputation of the Supreme Court, its credibility, how it managed the issue," said Antonio Barroso, deputy research director at the Teneo Intelligence analysis group.
"Sanchez saw a window of opportunity and is taking advantage of it."
Oriol Bartomeus, politics professor at the Autonomous University of Barcelona, concurred.
"The impact in society of the Supreme Court's measure is helping the prime minister take this decision, which is certainly controversial in terms of balance of powers," he said.
The news comes at a critical time for the Supreme Court, which is set to try Catalan separatist leaders early next year in what promises to be a hugely sensitive case.