Geographic Location
Madrid is the capital of Spain and situated in the very center of the country. The term Madrid can also refer to the administrative district ‘Comunidad de Madrid’ which does surround the city of Madrid.

Figure: Location of Madrid (Source)
At the very center of Madrid, at ‘Puerta del Sol’, which would also be the center of Spain, there is a stone mark. It’s where counting miles of radial roads in Spain starts and it’s called ‘kilómetro cero’. Besides, one should mention that Madrid is situated somewhat higher than the surrounding area on a plateau with an elevation of 667m over the sea level. The plateau can easily be seen for example from the teleferic station in Casa de Campo.
Population
Madrid has a population of nearly 3.Madrid has a population of nearly 3.2 million in the city itself. Taking into account the surrounding area with its suburbs, the number rises to nearly 6.1 million people. (Source) That makes Madrid the E.U.’s third biggest city after London and Berlin / Paris depending on what you count (metropolitan area or city only). (Source)
The biggest group of age lies around 30 to 34 years and the gender distribution can be seen in the following diagram:

Figure: Population of Madrid by gender and age (Source)
Another important point to mention are people from other countries and of foreign nationality living in Madrid. About half a million people living in Madrid are from other nations with most of them coming from South & Central America and Europe.

Figure: Foreigners in Madrid by continent (Source)

Figure: Foreigners in Madrid by region (Source)
Now if you don’t consider South and Central America which largely outnumber any other group of foreigners, there’s still a few numbers that do really stand out. It’s the number of people from Rumania, China and Morocco living in Madrid as you can see in the next diagram.

Figure: Foreigners in Madrid by country (Source)
Especially the people from Morocco and China are those one notices a lot when in Madrid. There are hundreds of Chinese food and every day goods shops in the streets of Madrid and after the supermarkets close at around 10 p.m., they’re the best choice if you need anything. For what concern’s the people from Morocco, similar to the Chinese, they’re run small Arabic shops. Besides, it’s usually them who are (illegally) selling fake DVDs, CDs and other goods in the streets.

Figure: Foreigners in Madrid by country (Europe) (Source)
Finally, let’s have a look at people from European and E.U. countries living in Madrid. Italy, Poland and France are clearly at the top of the list with Germany and UK being at the end of the list talking about the ‘big players’.

Figure: Foreigners in Madrid by country (European Union) (Source)
Administration
The city of Madrid has its own government (Junta de Gobierno de la Ciudad) lead by a mayor. Furthermore it’s subdivided into 21 districts, each with a local administration (Juntas Municipales de Distrito) (Source). Besides those institutions which do only concern Madrid as a city, the city is also the location of the administration of the Spanish district Madrid (Comunidad de Madrid) which is the ‘Asamblea de Madrid’ (Source). Last but not least, being the capital of Spain, Madrid is also home of the Spanish government consisting of the Congress and the Senate (Source). The royal palace is situated in Madrid, too.