FRANKFURT -- Spanish Prime Minister Mariano Rajoy has upped the ante in a constitutional and political crisis in Spain after he declared that he will end Catalonia's autonomy and reinstitute direct Spanish rule over the wealthy region. His move comes three weeks after Catalans (at least those who chose to participate) voted overwhelmingly for independence in a referendum which Spanish authorities deemed illegal.

While Rajoy may be correct under terms of the constitution, he is a hypocrite. Simply put, Spain is getting a taste of its own medicine.

Just three years ago, after all, the Spanish parliament, presided over by Rajoy, voted overwhelmingly to recognize Palestine as an independent state. While that vote was non-binding, Rajoy and his colleagues showed their disdain for international agreements and effectively endorsed the Palestinian leadership's shredding of commitments it had made to a negotiated process back in Oslo, in 1993. "I want to express my satisfaction that all [political parties] have decided to vote for this declaration," Spanish Foreign Minister Jose Garcia-Margallo said.

Javier Solana, a former Spanish foreign minister who rose through the ranks of the European Union bureaucracy to become the European Union's foreign policy chief, brought Spain's vision to Brussels when he urged the European Union as a whole to recognize Palestine as an independent state by a certain deadline whether or not Israel and Palestinian leaders had come to a negotiated agreement. Fortunately, most European officials were wiser and recognized that Solana and Spain's prescription would have undercut the peace process and guaranteed bloodshed.

But it's not just Spain's position with regard to the Middle East peace process which is problematic. Consider the Western Sahara: A former Spanish colony seized by Spain from Morocco during the 19th century, Morocco regained control of the region after Spain withdrew in 1975. But Algeria, a Cold War ally of the Soviet Union, sponsored the Polisario Front, an authoritarian Marxist group which formed the self-styled Sahrawi Arab Democratic Republic which claims to be the rightful rulers of the region. The Polisario claim is nonsense, but don't tell Spain. SADR maintains a representative office in Madrid, and Polisario terrorists launder money through both mainland Spain and the Canary Islands, an autonomous community of Spain located just 62 miles off the Moroccan coast.

Spanish hypocrisy runs deep and in the other direction. It continues to colonize Ceuta and Melilla, two territories on the northern African coast long ago seized from Morocco, all the while seeking to repossess Gibraltar, a British colony abutting mainland Spain, never mind that Gibraltar's residents have voted repeatedly to remain free from Spanish rule.

In short, for Spain, it's always good to support self-determination and independence so long as those people live far from Spain. While Rajoy cites the need to abide by the Spanish constitution, he ignores the rule-of-law and diplomatic processes in countries such as Israel and Morocco.

Unlike the Western Sahara, Catalonia has its own language and historical identity. Independence might not be an easy path for Catalonia; it is guaranteed neither entrance into the European Union or NATO and it might soon find its economy undercut by a passive aggressive, if not overtly hostile, Spain. It is also unlikely to win the support of either the United States or European Union countries. Nevertheless, if Spanish authorities feel that extra-legal separatism merits a crackdown, perhaps they might want to reconsider their own hypocritical foreign policy.

Michael Rubin (@Mrubin1971) is a contributor to the Washington Examiner's Beltway Confidential blog. He is a resident scholar at the American Enterprise Institute and a former Pentagon official.

If you would like to write an op-ed for the Washington Examiner, please read our guidelines on submissions here.