Chief Justice Roger Taney, acting only as a circuit judge, ruled on June 4, 1861, in "Ex parte Merryman" that Lincoln's suspension of habeas corpus was unconstitutional, but the president ignored the ruling in order to meet a national emergency. On September 17, 1861, the day the legislature reconvened, federal troops arrested without charge 27 state legislators (one-third of the Maryland General Assembly). They were held temporarily at Fort McHenry, and later released when Maryland was secured for the Union. Because a large part of the legislature was now imprisoned, the session was canceled and representatives did not consider any additional anti-war measures. The song "Maryland, My Maryland" was written to attack Lincoln's action in blocking pro-Confederate elements. Maryland contributed troops to both the Union (60,000) and the Confederate (25,000) armies. During the war, Maryland adopted a new state constitution in 1864 that prohibited slavery. It also freed all remaining slaves in the state.