While America was preoccupied with Afghanistan, and later Iraq, China took advantage of Washington's new focus to minimise tension with the superpower and enhance its standing and its influence with its Asian neighbours.
It would also highlight the fact that a country that has remained silently "friendly" to the US can no longer sit on the fence, quietly benefiting from its arrangement with the superpower.