During the American Civil War, Maryland did not secede from the Union. (That is, Maryland stayed a part of the Union and did not join the Confederacy.) When Union soldiers marched through the city at the start of the war, some people attacked the soldiers. This started the Baltimore riot of 1861. Four soldiers and 12 civilians were killed. After the riot, Union soldiers occupied (stayed in) Baltimore. During the war, Maryland was governed directly by the federal government and the state government did not have any power. This was to keep the state from seceding (leaving the Union). After the war ended in April 1865, Maryland began governing itself again.