deserter
A deserter is someone who leaves their country or military unit to fight against them. They are usually punished by being sent to prison or killed.
He was a deserter, and was sentenced to death.
The soldier deserted his unit and was captured by the enemy.