SEOUL (Reuters) - North Korea and Russia agreed to provide all available military assistance if the other side faces armed aggression, under an agreement signed by their leaders, the North's KCNA news agency reported on Thursday.

The two countries will not sign any treaty with a third country that infringes on the interests of the other and will not allow their territories to be used by any country to harm the other's security and sovereignty, KCNA said, citing the agreement.

North Korean leader Kim Jong Un and Russian President Vladimir Putin held talks in Pyongyang on Wednesday before announcing the signing of a comprehensive strategic partnership agreement.

KCNA on Thursday released the full text of the agreement, which also included cooperation on nuclear energy, space exploration, food and energy security.

(Reporting by Jack Kim; Editing by Kim Coghill and Gerry Doyle)