 When he became elector (ruler) of Brandenburg in 1640, the country was in ruins from the Thirty Years War; it had lost half its population from war, disease and emigration.The capital Berlin had only 6,000 people left when the wars ended in 1648.He united the multiple separate domains that his family had acquired primarily by marriage over the decades, and built the powerful unified state of Prussia out of them.