China and Vietnam reached an agreement on managing their South China Sea dispute through friendly talks, a senior Chinese diplomat said on Friday.