People settled around Cardiff about 6,000 years ago. By the 50s AD a tribe called the Silures had a settlement in the centre, and the Romans later built a fort there. The Welsh name, Caerdydd, comes from caer, a fort, and Taf. The Romans left near the start of the 5th century. You can still see their wall line marked around the castle base.
Vikings used the coast as a base from about 850, and two street names are theirs: Dumballs Road and Womanby Street. In 1091 the Norman lord Robert Fitzhamon began work on a keep inside the old Roman walls. A small town grew up in the castle's shadow, mostly settlers from England. By the end of the 13th century it was the only town in Wales above 2,000 people. The medieval street pattern survives around High Street.
Cardiff was attacked several times between 1158 and 1316. Then in 1404 Owain Glyndŵr took the castle and burned the town. Most buildings were wood, so little was left. The Act of Union made it the county town of Glamorgan in 1536, and the last major battle fought in Wales took place at nearby St Fagans.
By 1801 Cardiff had 1,870 people and ranked only twenty-fifth among Welsh towns. It was described as an obscure and inconsiderable place. Then the 2nd Marquess of Bute built a dock linked to the Taff Vale Railway, and Cardiff became the outlet for coal from the Rhondda, Cynon and Rhymney valleys. It grew by nearly 80% a decade between 1840 and 1870. Migrants poured in: by 1851 a quarter of residents were English-born and over 10% Irish. By 1881 Cardiff was the largest town in Wales.
The Coal Exchange set the British price of coal, and in 1907 it saw the first deal worth a million pounds. The Marquess hired the architect William Burges for many buildings in a distinctive Gothic style, and donated land for a civic centre of City Hall, the National Museum and university buildings. Edward VII made Cardiff a city in 1905. Trade drained away between the wars: by 1936 it was less than half its 1913 value.
Cardiff became capital of Wales only in 1955, by a written reply from the Home Secretary. National government only arrived with the Welsh Office in 1964. The East Moors steelworks closed in 1978. Cardiff voters rejected a Welsh Assembly in 1997, by 55.4% to 44.2%, yet it still met in the Bay from 1999 and gained a new debating chamber there in 2005.
The centre has been pedestrianised on a large scale, and the St David's redevelopment arrived in 2009. The Bay, sometimes known as Tiger Bay, was the earliest part of modern Britain seen as multicultural. The Somali community there is one of the oldest and largest in the world outside Somalia.