A river gunboat is a type of gunboat adapted for river operations. River gunboats required shallow draft for river navigation. They would be armed with relatively small caliber cannons, or a mix of cannons and machine guns. If they carried more than one cannon, one might be a howitzer, for shore bombardment. They were usually not armoured. The USS San Pablo described in Richard McKenna's The Sand Pebbles is an example of this class of vessel, serving on the US Navy's Yangtze Patrol. Stronger river warships were river monitors.
Various European powers, the USA, and Japan, maintained flotillas of these shallow draft gunboats patrolling Chinese rivers. These gunboats were enforcing those nations' treaty rights under the treaties that China had started to sign following her defeat during the first Opium War with Britain. The advantages of steam power and shallow drafts meant that the new European vessels initially vastly outclassed anything available to the Chinese.
Foreign powers had coerced concessions from China, like extraterritoriality for their citizens in China, and the gunboats policed these rights.
Royal Navy (RN) gunboats, numbering on average 15 a year in Chinese waters, served as "station ships", assigned to specific ports, and were designed for river functions. The RN maintained patrols and escorts up and down the Yangtze based in Shanghai until the end of the International Concessions in 1941. These boats were part of the Navy's China Station and vessels of various classes were deployed and often moved to and from other major world rivers. The Navy had built a large number of gunboats for the Crimean war in the 1850s and several of these found their way to the China Station afterwards. As these boats were scrapped they were replaced by types purpose built for inshore and river service around the world, Beacon- and later Frolic-class boats.