Recently I read a book named Dawn of Empire by Sam Barone, which is set around 3000BC in Mesopotamia, on the Tigris river. It is a time when tribes of marauding raiders live by attacking settlements and taking what they need - horses, food, women, etc - and hate the "dirt eaters" who live by agriculture.
The book is about a city which builds the first real wall and manages to fight off a siege by the barbarian hordes, and ultimately ends up founding the Akkadian empire. The Akkadians were a very old civilization, nearly as old as the Sumerians (the first known civilization of man), and were a favorite of writers like Robert Howard. The Scorpion King, for example, is an Akkadian survivior, the last of his kind.
The book has some historical oddities (like measuring by hectares) and has some gratuitous sex, but was fun to read and interesting. But the wall was interesting, how they dealt with building the wall out of clay bricks and wooden platforms, how they dealt with fire attacks and so on. Its implausible that one guy in a city figured out all the basics of siege fighting in a single confrontation, but it works anyway.
But it appears that fully walled cities were around pretty early. Generally speaking if you look up old cities in books you'll find that they depict the fortifications like this:
But in Europe there were apparently far more substantial and older cities with greater walls than this in ancient times. A recent dig in Bulgaria has revealed a very ancient city, dating into the era of 4000BC and is believed to be the oldest city ever found in Europe. The Associated Press reports:
Vasil Nikolov, a professor from Bulgaria's National Institute of Archaeology, said the stone walls excavated by his team near the town of Provadia are estimated to date between 4,700 and 4,200 B.C. He said the walls, which are 6 feet high and 4 ½ feet thick, are believed to be the earliest and most massive fortifications from Europe's prehistory.Excavations have also uncovered a series of pits used for rituals as well as parts of a gate. Carbon analysis has dated them to the Chalcolithic age to between 4,700 and 4,200 B.C., he said — more than a millennium before the start of the ancient Greek civilization.
By the way, their dating is "BC" not the idiotic "BCE" construct academics invented to avoid thinking about Christ. I'd love to see that little experiment go away if for no other reason than it accomplishes nothing constructive and is inherently irrational. Just changing the name doesn't help you get away from Jesus Christ: what happened around that time period to justify the shift from "before common era" to "common era?" Jesus Christ.
However, while carbon dating isn't nearly as precise or easy to properly use as it is generally depicted and understood, it is interesting to find a city that incredibly ancient that far north and west of the Middle East where civilization is generally known to have first arisen. 300 or so people doesn't seem like much of a town to us today, but for the people living there, the walls and protection of gathering there was pretty important. There were copper items (needles, the article mentions) at the site, and structures as tall as two stories, which is an impressive achievement with their limited technology.
As I wrote about a while back, many existing cities today are built on the bones of ancient cities and settlements from long before their current nations. Often, several attempts to build a city were started and failed in the area, creating multiple archaeological sites nearby a major, ancient city.