It is located in the southernmost part of the mainland of China; bordering the South China Sea in the east and Beibu Gulf in the west; being separated from Hainan by the 18 nautical miles wide Qiongzhou Strait.