By the end of the 18th century, the city contained more than 3,000 brick buildings. The harbour fostered trade, and played part in several naval wars of the 18th century. Kingston took over the functions of Spanish Town (the capital at the time). These functions included agriculture, commercial, processing and a main transport hub to and from Kingston and other sections of the island. In 1788, Kingston had a population of 25,000, which was about a tenth of the overall population of the island. One in every four people living in Kingston was white, and there was a large population of free people of color there too, meaning that two out of every five people living in Kingston were free. The remaining three-fifths of Kingston's population was made up of black slaves.