Earty settlement in the Tianjin region dates back to the Warring States period，but Tianjin's later prominence was primarily tied to the rise of nearby Beijing as the capital of northern nomadic dynasties and later of the country as a whole. Tianjin served primarily as a storage，sale，and distribution center for agricultural products from the south as early as from the 12th century.
Tianjin's prosperity proved a lure for Western trading nations. In 1856 British and French troops used the boarding of a British ship by Chinese troops in search of pirates as an excuse to attack the forts guarding the Haihe River. The defeated Chinese were forced to sign the 1858 Treaty of Tianjin，which opened the port to foreign trade and the sale of opium. Other European nations and Japan followed，establishing distinctive independent concessions on the riverside areas，each with a distinctive architectural style-variously English Victorian，Italian Roman style streets，French chateaux styles，and German Bavarian villas.
Tianjin became a center of urban modernization and internationalism in the early years of the 20th century. Hotels like the Astor received famous guests such as Herbert Hoover and Sun Yat-sen，and one of China's first elevators was installed there in 1924.
Meanwhile，heavy silting of the Haihe River led to construction of a new port at Tanggu，50 km downriver, as Tianjin lost its character as a major port city. The1976 Tangshan earthquake caused extensive damage to the city，and it was closed to foreign visitors until repairs were completed. The establishment of the Tianjin Economic and Development Area was a major spur to investment and economic revitalization.