Thailand and Cambodia signed a ceasefire on Saturday to end weeks of border fighting over territorial claims.