Stirling's fifth and final command was as Commander in Chief, China and the East Indies Station, and his flag, as Rear Admiral of the White, was hoisted on on 11 May 1854. Shortly afterwards news arrived that war had been declared on Russia. Stirling was anxious to prevent Russian ships from sheltering in Japanese ports and menacing allied shipping and, after lengthy negotiations through the Nagasaki Magistrate, concluded a Treaty of Friendship with the Japanese. The treaty was endorsed by the British Government, but Stirling was criticised in the popular press for not finding and engaging with the Russian fleet.