Answer :

TSO
That would be called treason, and if you are found guilty on such a charge, you will face a lot of consequences.
A crime of betraying your countries government is called treason. In most countries, treason is punishable by death. There are actually few forms of treason and many forms of treason overlaps with other crimes.

One would be in conspiracy against the government such as plotting an assassination against a government official

Another form of it which is often set as its own additional crime is giving aid to the countries enemies. An example would be giving classified information to terrorist or a foreign country which overlaps with the crime of espionage.

But as you can see, treason is generally a crime that is in act against ones own country