While the violence in the North was still raging, the South of Ireland was preoccupied with the split in the Dáil and in the IRA over the treaty. In April 1922, an executive of IRA officers repudiated the treaty and the authority of the Provisional Government which had been set up to administer it. These republicans held that the Dáil did not have the right to disestablish the Irish Republic. A hardline group of Anti-Treaty IRA men occupied several public buildings in Dublin in an effort to bring down the treaty and restart the war with the British. There were a number of armed confrontations between pro and anti-treaty troops before matters came to a head in late June 1922. Desperate to get the new Irish Free State off the ground and under British pressure, Michael Collins attacked the anti-treaty militants in Dublin, causing fighting to break out around the country. The subsequent Irish Civil War lasted until mid-1923 and cost the lives of many of the leaders of the independence movement, notably the head of the Provisional Government Michael Collins, ex-minister Cathal Brugha, and anti-treaty republicans Harry Boland, Rory O'Connor, Liam Mellows, Liam Lynch and many others: total casualties have never been determined but were perhaps higher than those in the earlier fighting against the British. President Arthur Griffith also died of a stroke during the conflict. Following the deaths of Griffith and Collins, W. T. Cosgrave became head of government. On 6 December 1922, following the coming into legal existence of the Irish Free State, W. T. Cosgrave became President of the Executive Council, the first internationally recognised head of an independent Irish government. The civil war ended in mid-1923 in defeat for the anti-treaty side.
Question: Which happened first, Michael Collins attack or the end of the war?
Answer: Michael Collins attacked