During the 1848 First Italian War of Independence, Venetia rose against the central Austrian government, forming the Republic of San Marco, which lasted 17 months. It asked to be annexed to the Kingdom of Sardinia to form an Italian confederation against Austria, then using the Italian tricolour in its flag, but, after the other Italian states left the war (May 1848) and Sardinia surrendered (August 1848, then March 1849), Venetia stood alone. It surrendered on 24 August 1849, when the Siege of Venice ended.