Madrid remained in Republican hands for most of the war, but the government was evacuated in the early stages of a nationalist siege that lasted until March 1939.
The Republicans retained Madrid for the majority of the war, however the government escaped early on.
Madrid was lost quickly in the war and the government officials could not escape from the nationalist siege.