The incident happened just before 11pm on Friday night in the Long Lane area of the town.
The man suffered serious injuries in the incident.
The victim was rushed to Letterkenny General Hospital where he was transferred to the ICU unit.
One Garda source confirmed that a “serious assault” had taken place.
Gardai as well as ambulance personnel rushed to the scene of the attack on Friday night.
Armed gardai searched a number of houses in a follow-up operation and two men were detained and a number of weapons seized.
Two men were later arrested and are due to appear in court in Letterkenny tomorrow.