Two countries sign economic and security pact, as China expresses concern that the agreement may be targeted at it.