Although numerous naval battles took place before the 12th century, such as the large-scale Three Kingdoms Battle of Chibi in the year 208, it was during the Song Dynasty (960–1279 AD) that the Chinese established a permanent, standing navy in 1132 AD. At its height by the late 12th century there were 20 squadrons of some 52,000 marines, with the admiral's headquarters at Dinghai, while the main base remained closer to modern Shanghai in those days. The establishment of the permanent navy during the Song period came out of the need to defend against the Jurchens, who had overrun the northern half of China, and to escort merchant fleets entering the South East Pacific and Indian Ocean on long trade missions abroad to the Hindu, Islamic, and East African spheres of the world. However, considering China was a country which was longtime menaced by land-based nomadic tribes such as the Xiongnu, Göktürks, Mongols and so on, the navy was always seen as an adjunct rather than an important military force. By the 15–16th centuries China's canal system and internal economy were sufficiently developed to nullify the need for the Pacific fleet, which was scuttled when conservative Confucianists gained power in the court and began a policy of introspection. After the First and Second Opium Wars, which shook up the generals of the Qing dynasty, the government attached greater importance to the navy.
When the British fleet encountered the Chinese during the First Opium War, their officers noted the appearance of paddle-wheel boats among the Chinese fleet, which they took for a copy of the Western design. Paddle-wheel boats were actually developed by the Chinese independently in the 5th–6th centuries, only a century after their first surviving mention in Roman sources (see Paddle steamer), though that method of propulsion had been abandoned for many centuries and only recently reintroduced before the war. Numerous other innovations were present in Chinese vessels during the Middle Ages that had not yet been adopted by the Western and Islamic worlds, some of which were documented by Marco Polo but which did not enter into other navies until the 18th century, when the British successfully incorporated them into ship designs. For example, medieval Chinese hulls were split into bulkhead sections so that a hull rupture only flooded a fraction of the ship and did not necessarily sink it (see Ship floodability). This was described in the book of the Song Dynasty maritime author Zhu Yu, the Pingzhou Table Talks of 1119 AD. Along with the innovations described in Zhu's book, there were many other improvements to nautical technology in the medieval Song period. These included crossbeams bracing the ribs of ships to strengthen them, rudders that could be raised or lowered to allow ships to travel in a wider range of water depths, and the teeth of anchors arranged circularly instead of in one direction, "making them more reliable". Junks also had their sails staggered by wooden poles so that the crew could raise and lower them with ropes from the deck, like window blinds, without having to climb around and tie or untie various ropes every time the ship needed to turn or adjust speed.
A significant naval battle was the Battle of Lake Poyang from August 30 to October 4 of the year 1363 AD, a battle which cemented the success of Zhu Yuanzhang in founding the Ming Dynasty. However, the Chinese fleet shrank tremendously after its military/tributary/exploratory functions in the early 15th century were deemed too expensive and it became primarily a police force on routes like the Grand Canal. Ships like the juggernauts of Zheng He's "treasure fleet," which dwarfed the largest Portuguese ships of the era by several times, were discontinued, and the junk became the predominant Chinese vessel until the country's relatively recent (in terms of Chinese sailing history) naval revival.
One of the oldest known Chinese books written on naval matters was the Yuejueshu (Lost Records of the State of Yue) of 52 AD, attributed to the Han Dynasty scholar Yuan Kang. Many passages of Yuan Kang's book were rewritten and published in Li Fang's Imperial Reader of the Taiping Era, compiled in AD 983. The preserved written passages of Yuan Kang's book were again featured in the Yuanjian Leihan (Mirror of the Infinite, a Classified Treasure Chest) encyclopedia, edited and compiled by Zhang Ying in 1701 during the Qing Dynasty.