Irish revolutionary period
In 1918 Sweeney was suffering from influenza and decided to take a break from UCD and return to Donegal. While there he was appointed a commandant of the local Volunteers as well as being elected as a Sinn Féin MP for Donegal West in the 1918 Irish general election, defeating the sitting nationalist Hugh Law. Aged 21, had he taken his seat in the British Commons he would have been the youngest member of the house, however, as per Sinn Féin's abstentionist policy he did not and instead attended the meeting of the First Dáil, the new parliament of Ireland created by the Nationalists. He was the youngest Teachta Dála that day and he remains second youngest ever TD to date.
In March 1920 he was arrested and jailed by the British authorities, first being sent to Belfast before being transferred to Wormwood Scrubs, London. He was released in April 1920 following his participation in a mass hunger strike by Irish prisoners against their imprisonment. Following his release, he became Officer Commanding of the West Donegal Brigade of the Irish Republican Army and fought in the Irish War of Independence. During that time he rose through the ranks and became the commanding officer of the 1st Northern Division.
Following the end of the War of Independence and the signing of the Anglo-Irish Treaty, Sweeney chose the Pro-Treaty side in the Irish Civil War. In the lead-up to the civil war, he was involved in smuggling arms across the border to northern nationalists, which lead to clashes with British troops. During one such clash seven of his men were killed at Pettigo.
In 1921 he was one of six Sinn Féin candidates elected unopposed to the House of Commons of Southern Ireland for Donegal. Again, Sinn Féin did not attend and instead formed the Second Dáil. In 1922 he was re-elected as a Pro-Treaty Sinn Féin candidate for Donegal and participated in the 3rd Dáil.
During the Civil War, he was made a General in the newly formed National Army and placed in command of its units in the North-West of the Island. The period saw Sweeney ordered by the Irish Government to execute four captured Republicans, including a former friend, Charlie Daly. The men had been captured and tried under the public safety bill by which anyone who was caught bearing arms against the state could be put to death. The men were in captivity without sentencing for a long period until the killing of Captain Bernard Cannon in Creeslough, County Donegal forced the Government to react and they ordered the men to be executed. Before their executions on 14 March 1923, the four men had all been offered a reprieve if they signed a document worded 'Declaration": "I promise that I will not use arms against the Parliament elected by the Irish people, or the Government for the time being responsible to that Parliament, and that I will not support in any way such action. Nor will I interfere with the property or person of others."' All refused.