The Alliance Conducted at Sea was a political alliance in Chinese history between the Han-led Northern Song dynasty and Jurchen-led Jin dynasty in the early 12th century against the Khitan-led Liao dynasty. The alliance was negotiated from 1115 to 1123 by envoys who crossed the Bohai Sea. Under the alliance, the two nations agreed to jointly invade Liao and split captured territories, forswore making unilateral peace with Liao, and Jin agreed to cede the Sixteen Prefectures to Song. Between 1121 and 1123, Song faltered in their military campaigns, while Jin succeeded in driving remnants of the Liao imperial court to Central Asia where they formed the Western Liao dynasty. Jin handed over several of the Sixteen Prefectures to Song including modern-day Beijing. However, in 1125, the alliance ended when Jin, sensing Song's weakness, invaded southward and eventually captured the Song capital of Bianjing in 1127.